From accca40c1a30e371abf9f7a2f72c07bead717432 Mon Sep 17 00:00:00 2001 From: hc-github-team-tf-azure <> Date: Wed, 3 Apr 2024 13:29:36 +0000 Subject: [PATCH] Updating based on 244e0657 --- .../loadtestservice/2022-12-01/client.go | 9 - .../2022-12-01/loadtest/README.md | 37 --- .../2022-12-01/loadtest/client.go | 26 -- .../2022-12-01/loadtest/id_loadtest.go | 125 -------- .../2022-12-01/loadtest/id_loadtest_test.go | 282 ------------------ .../2022-12-01/loadtest/predicates.go | 17 -- .../2022-12-01/loadtest/version.go | 12 - .../2022-12-01/loadtests/README.md | 19 +- .../2022-12-01/loadtests/method_delete.go | 1 - ...istoutboundnetworkdependenciesendpoints.go | 8 +- .../2022-12-01/loadtests/method_update.go | 4 +- .../model_endpointdependency.go | 4 +- .../model_endpointdetail.go | 2 +- .../model_loadtestresourcepatchrequestbody.go | 14 - .../loadtests/model_loadtestresourceupdate.go | 14 + ...model_loadtestresourceupdateproperties.go} | 2 +- .../model_outboundenvironmentendpoint.go | 2 +- .../2022-12-01/loadtests/predicates.go | 13 + .../model_checkquotaavailabilityresponse.go | 4 +- .../quotas/model_quotabucketrequest.go | 8 - 20 files changed, 58 insertions(+), 545 deletions(-) delete mode 100644 resource-manager/loadtestservice/2022-12-01/loadtest/README.md delete mode 100644 resource-manager/loadtestservice/2022-12-01/loadtest/client.go delete mode 100644 resource-manager/loadtestservice/2022-12-01/loadtest/id_loadtest.go delete mode 100644 resource-manager/loadtestservice/2022-12-01/loadtest/id_loadtest_test.go delete mode 100644 resource-manager/loadtestservice/2022-12-01/loadtest/predicates.go delete mode 100644 resource-manager/loadtestservice/2022-12-01/loadtest/version.go rename resource-manager/loadtestservice/2022-12-01/{loadtest => loadtests}/method_listoutboundnetworkdependenciesendpoints.go (77%) rename resource-manager/loadtestservice/2022-12-01/{loadtest => loadtests}/model_endpointdependency.go (80%) rename resource-manager/loadtestservice/2022-12-01/{loadtest => loadtests}/model_endpointdetail.go (92%) delete mode 100644 resource-manager/loadtestservice/2022-12-01/loadtests/model_loadtestresourcepatchrequestbody.go create mode 100644 resource-manager/loadtestservice/2022-12-01/loadtests/model_loadtestresourceupdate.go rename resource-manager/loadtestservice/2022-12-01/loadtests/{model_loadtestresourcepatchrequestbodyproperties.go => model_loadtestresourceupdateproperties.go} (84%) rename resource-manager/loadtestservice/2022-12-01/{loadtest => loadtests}/model_outboundenvironmentendpoint.go (94%) diff --git a/resource-manager/loadtestservice/2022-12-01/client.go b/resource-manager/loadtestservice/2022-12-01/client.go index 8805cb69386..a32ca9a5b23 100644 --- a/resource-manager/loadtestservice/2022-12-01/client.go +++ b/resource-manager/loadtestservice/2022-12-01/client.go @@ -6,7 +6,6 @@ package v2022_12_01 import ( "fmt" - "github.com/hashicorp/go-azure-sdk/resource-manager/loadtestservice/2022-12-01/loadtest" "github.com/hashicorp/go-azure-sdk/resource-manager/loadtestservice/2022-12-01/loadtests" "github.com/hashicorp/go-azure-sdk/resource-manager/loadtestservice/2022-12-01/quotas" "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" @@ -14,18 +13,11 @@ import ( ) type Client struct { - LoadTest *loadtest.LoadTestClient LoadTests *loadtests.LoadTestsClient Quotas *quotas.QuotasClient } func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - loadTestClient, err := loadtest.NewLoadTestClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building LoadTest client: %+v", err) - } - configureFunc(loadTestClient.Client) - loadTestsClient, err := loadtests.NewLoadTestsClientWithBaseURI(sdkApi) if err != nil { return nil, fmt.Errorf("building LoadTests client: %+v", err) @@ -39,7 +31,6 @@ func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanag configureFunc(quotasClient.Client) return &Client{ - LoadTest: loadTestClient, LoadTests: loadTestsClient, Quotas: quotasClient, }, nil diff --git a/resource-manager/loadtestservice/2022-12-01/loadtest/README.md b/resource-manager/loadtestservice/2022-12-01/loadtest/README.md deleted file mode 100644 index bf536d63bd2..00000000000 --- a/resource-manager/loadtestservice/2022-12-01/loadtest/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/loadtestservice/2022-12-01/loadtest` Documentation - -The `loadtest` SDK allows for interaction with the Azure Resource Manager Service `loadtestservice` (API Version `2022-12-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/loadtestservice/2022-12-01/loadtest" -``` - - -### Client Initialization - -```go -client := loadtest.NewLoadTestClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `LoadTestClient.ListOutboundNetworkDependenciesEndpoints` - -```go -ctx := context.TODO() -id := loadtest.NewLoadTestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadTestValue") - -// alternatively `client.ListOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination -items, err := client.ListOutboundNetworkDependenciesEndpointsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/loadtestservice/2022-12-01/loadtest/client.go b/resource-manager/loadtestservice/2022-12-01/loadtest/client.go deleted file mode 100644 index bb1ff619ba7..00000000000 --- a/resource-manager/loadtestservice/2022-12-01/loadtest/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package loadtest - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadTestClient struct { - Client *resourcemanager.Client -} - -func NewLoadTestClientWithBaseURI(sdkApi sdkEnv.Api) (*LoadTestClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "loadtest", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating LoadTestClient: %+v", err) - } - - return &LoadTestClient{ - Client: client, - }, nil -} diff --git a/resource-manager/loadtestservice/2022-12-01/loadtest/id_loadtest.go b/resource-manager/loadtestservice/2022-12-01/loadtest/id_loadtest.go deleted file mode 100644 index 67b2af064d1..00000000000 --- a/resource-manager/loadtestservice/2022-12-01/loadtest/id_loadtest.go +++ /dev/null @@ -1,125 +0,0 @@ -package loadtest - -import ( - "fmt" - "strings" - - "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 = &LoadTestId{} - -// LoadTestId is a struct representing the Resource ID for a Load Test -type LoadTestId struct { - SubscriptionId string - ResourceGroupName string - LoadTestName string -} - -// NewLoadTestID returns a new LoadTestId struct -func NewLoadTestID(subscriptionId string, resourceGroupName string, loadTestName string) LoadTestId { - return LoadTestId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadTestName: loadTestName, - } -} - -// ParseLoadTestID parses 'input' into a LoadTestId -func ParseLoadTestID(input string) (*LoadTestId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadTestId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadTestId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLoadTestIDInsensitively parses 'input' case-insensitively into a LoadTestId -// note: this method should only be used for API response data and not user input -func ParseLoadTestIDInsensitively(input string) (*LoadTestId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadTestId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadTestId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LoadTestId) 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.LoadTestName, ok = input.Parsed["loadTestName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadTestName", input) - } - - return nil -} - -// ValidateLoadTestID checks that 'input' can be parsed as a Load Test ID -func ValidateLoadTestID(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 := ParseLoadTestID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Load Test ID -func (id LoadTestId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.LoadTestService/loadTests/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadTestName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Load Test ID -func (id LoadTestId) 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("staticMicrosoftLoadTestService", "Microsoft.LoadTestService", "Microsoft.LoadTestService"), - resourceids.StaticSegment("staticLoadTests", "loadTests", "loadTests"), - resourceids.UserSpecifiedSegment("loadTestName", "loadTestValue"), - } -} - -// String returns a human-readable description of this Load Test ID -func (id LoadTestId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Test Name: %q", id.LoadTestName), - } - return fmt.Sprintf("Load Test (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/loadtestservice/2022-12-01/loadtest/id_loadtest_test.go b/resource-manager/loadtestservice/2022-12-01/loadtest/id_loadtest_test.go deleted file mode 100644 index 78e68054476..00000000000 --- a/resource-manager/loadtestservice/2022-12-01/loadtest/id_loadtest_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package loadtest - -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 = &LoadTestId{} - -func TestNewLoadTestID(t *testing.T) { - id := NewLoadTestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadTestValue") - - if id.SubscriptionId != "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.LoadTestName != "loadTestValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadTestName'", id.LoadTestName, "loadTestValue") - } -} - -func TestFormatLoadTestID(t *testing.T) { - actual := NewLoadTestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadTestValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LoadTestService/loadTests/loadTestValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLoadTestID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadTestId - }{ - { - // 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.LoadTestService", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LoadTestService/loadTests", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LoadTestService/loadTests/loadTestValue", - Expected: &LoadTestId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadTestName: "loadTestValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LoadTestService/loadTests/loadTestValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadTestID(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.LoadTestName != v.Expected.LoadTestName { - t.Fatalf("Expected %q but got %q for LoadTestName", v.Expected.LoadTestName, actual.LoadTestName) - } - - } -} - -func TestParseLoadTestIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadTestId - }{ - { - // 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.LoadTestService", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LoadTestService/loadTests", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOaDtEsTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LoadTestService/loadTests/loadTestValue", - Expected: &LoadTestId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadTestName: "loadTestValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LoadTestService/loadTests/loadTestValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOaDtEsTs/lOaDtEsTvAlUe", - Expected: &LoadTestId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadTestName: "lOaDtEsTvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOaDtEsTs/lOaDtEsTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadTestIDInsensitively(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.LoadTestName != v.Expected.LoadTestName { - t.Fatalf("Expected %q but got %q for LoadTestName", v.Expected.LoadTestName, actual.LoadTestName) - } - - } -} - -func TestSegmentsForLoadTestId(t *testing.T) { - segments := LoadTestId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LoadTestId 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/loadtestservice/2022-12-01/loadtest/predicates.go b/resource-manager/loadtestservice/2022-12-01/loadtest/predicates.go deleted file mode 100644 index e973f1c4554..00000000000 --- a/resource-manager/loadtestservice/2022-12-01/loadtest/predicates.go +++ /dev/null @@ -1,17 +0,0 @@ -package loadtest - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OutboundEnvironmentEndpointOperationPredicate struct { - Category *string -} - -func (p OutboundEnvironmentEndpointOperationPredicate) Matches(input OutboundEnvironmentEndpoint) bool { - - if p.Category != nil && (input.Category == nil || *p.Category != *input.Category) { - return false - } - - return true -} diff --git a/resource-manager/loadtestservice/2022-12-01/loadtest/version.go b/resource-manager/loadtestservice/2022-12-01/loadtest/version.go deleted file mode 100644 index ce6160f2eb2..00000000000 --- a/resource-manager/loadtestservice/2022-12-01/loadtest/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadtest - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-12-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/loadtest/%s", defaultApiVersion) -} diff --git a/resource-manager/loadtestservice/2022-12-01/loadtests/README.md b/resource-manager/loadtestservice/2022-12-01/loadtests/README.md index 0170ed8f451..67ab44e47fe 100644 --- a/resource-manager/loadtestservice/2022-12-01/loadtests/README.md +++ b/resource-manager/loadtestservice/2022-12-01/loadtests/README.md @@ -100,13 +100,30 @@ for _, item := range items { ``` +### Example Usage: `LoadTestsClient.ListOutboundNetworkDependenciesEndpoints` + +```go +ctx := context.TODO() +id := loadtests.NewLoadTestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadTestValue") + +// alternatively `client.ListOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination +items, err := client.ListOutboundNetworkDependenciesEndpointsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + ### Example Usage: `LoadTestsClient.Update` ```go ctx := context.TODO() id := loadtests.NewLoadTestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadTestValue") -payload := loadtests.LoadTestResourcePatchRequestBody{ +payload := loadtests.LoadTestResourceUpdate{ // ... } diff --git a/resource-manager/loadtestservice/2022-12-01/loadtests/method_delete.go b/resource-manager/loadtestservice/2022-12-01/loadtests/method_delete.go index 19ba7605ae4..fbd0cd6c147 100644 --- a/resource-manager/loadtestservice/2022-12-01/loadtests/method_delete.go +++ b/resource-manager/loadtestservice/2022-12-01/loadtests/method_delete.go @@ -27,7 +27,6 @@ func (c LoadTestsClient) Delete(ctx context.Context, id LoadTestId) (result Dele ExpectedStatusCodes: []int{ http.StatusAccepted, http.StatusNoContent, - http.StatusOK, }, HttpMethod: http.MethodDelete, Path: id.ID(), diff --git a/resource-manager/loadtestservice/2022-12-01/loadtest/method_listoutboundnetworkdependenciesendpoints.go b/resource-manager/loadtestservice/2022-12-01/loadtests/method_listoutboundnetworkdependenciesendpoints.go similarity index 77% rename from resource-manager/loadtestservice/2022-12-01/loadtest/method_listoutboundnetworkdependenciesendpoints.go rename to resource-manager/loadtestservice/2022-12-01/loadtests/method_listoutboundnetworkdependenciesendpoints.go index 6b75e8af9b9..248fe375eda 100644 --- a/resource-manager/loadtestservice/2022-12-01/loadtest/method_listoutboundnetworkdependenciesendpoints.go +++ b/resource-manager/loadtestservice/2022-12-01/loadtests/method_listoutboundnetworkdependenciesendpoints.go @@ -1,4 +1,4 @@ -package loadtest +package loadtests import ( "context" @@ -24,7 +24,7 @@ type ListOutboundNetworkDependenciesEndpointsCompleteResult struct { } // ListOutboundNetworkDependenciesEndpoints ... -func (c LoadTestClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, id LoadTestId) (result ListOutboundNetworkDependenciesEndpointsOperationResponse, err error) { +func (c LoadTestsClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, id LoadTestId) (result ListOutboundNetworkDependenciesEndpointsOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -62,12 +62,12 @@ func (c LoadTestClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Con } // ListOutboundNetworkDependenciesEndpointsComplete retrieves all the results into a single object -func (c LoadTestClient) ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, id LoadTestId) (ListOutboundNetworkDependenciesEndpointsCompleteResult, error) { +func (c LoadTestsClient) ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, id LoadTestId) (ListOutboundNetworkDependenciesEndpointsCompleteResult, error) { return c.ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate(ctx, id, OutboundEnvironmentEndpointOperationPredicate{}) } // ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadTestClient) ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate(ctx context.Context, id LoadTestId, predicate OutboundEnvironmentEndpointOperationPredicate) (result ListOutboundNetworkDependenciesEndpointsCompleteResult, err error) { +func (c LoadTestsClient) ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate(ctx context.Context, id LoadTestId, predicate OutboundEnvironmentEndpointOperationPredicate) (result ListOutboundNetworkDependenciesEndpointsCompleteResult, err error) { items := make([]OutboundEnvironmentEndpoint, 0) resp, err := c.ListOutboundNetworkDependenciesEndpoints(ctx, id) diff --git a/resource-manager/loadtestservice/2022-12-01/loadtests/method_update.go b/resource-manager/loadtestservice/2022-12-01/loadtests/method_update.go index 537cda3b04e..49392028d83 100644 --- a/resource-manager/loadtestservice/2022-12-01/loadtests/method_update.go +++ b/resource-manager/loadtestservice/2022-12-01/loadtests/method_update.go @@ -22,7 +22,7 @@ type UpdateOperationResponse struct { } // Update ... -func (c LoadTestsClient) Update(ctx context.Context, id LoadTestId, input LoadTestResourcePatchRequestBody) (result UpdateOperationResponse, err error) { +func (c LoadTestsClient) Update(ctx context.Context, id LoadTestId, input LoadTestResourceUpdate) (result UpdateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -61,7 +61,7 @@ func (c LoadTestsClient) Update(ctx context.Context, id LoadTestId, input LoadTe } // UpdateThenPoll performs Update then polls until it's completed -func (c LoadTestsClient) UpdateThenPoll(ctx context.Context, id LoadTestId, input LoadTestResourcePatchRequestBody) error { +func (c LoadTestsClient) UpdateThenPoll(ctx context.Context, id LoadTestId, input LoadTestResourceUpdate) error { result, err := c.Update(ctx, id, input) if err != nil { return fmt.Errorf("performing Update: %+v", err) diff --git a/resource-manager/loadtestservice/2022-12-01/loadtest/model_endpointdependency.go b/resource-manager/loadtestservice/2022-12-01/loadtests/model_endpointdependency.go similarity index 80% rename from resource-manager/loadtestservice/2022-12-01/loadtest/model_endpointdependency.go rename to resource-manager/loadtestservice/2022-12-01/loadtests/model_endpointdependency.go index 4d209faf21e..8ff73ed6f96 100644 --- a/resource-manager/loadtestservice/2022-12-01/loadtest/model_endpointdependency.go +++ b/resource-manager/loadtestservice/2022-12-01/loadtests/model_endpointdependency.go @@ -1,10 +1,10 @@ -package loadtest +package loadtests // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type EndpointDependency struct { Description *string `json:"description,omitempty"` - DomainName *string `json:"domainName,omitempty"` + DomainName string `json:"domainName"` EndpointDetails *[]EndpointDetail `json:"endpointDetails,omitempty"` } diff --git a/resource-manager/loadtestservice/2022-12-01/loadtest/model_endpointdetail.go b/resource-manager/loadtestservice/2022-12-01/loadtests/model_endpointdetail.go similarity index 92% rename from resource-manager/loadtestservice/2022-12-01/loadtest/model_endpointdetail.go rename to resource-manager/loadtestservice/2022-12-01/loadtests/model_endpointdetail.go index d2c1e6ffb3e..2995201d811 100644 --- a/resource-manager/loadtestservice/2022-12-01/loadtest/model_endpointdetail.go +++ b/resource-manager/loadtestservice/2022-12-01/loadtests/model_endpointdetail.go @@ -1,4 +1,4 @@ -package loadtest +package loadtests // 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/loadtestservice/2022-12-01/loadtests/model_loadtestresourcepatchrequestbody.go b/resource-manager/loadtestservice/2022-12-01/loadtests/model_loadtestresourcepatchrequestbody.go deleted file mode 100644 index a07321e30cd..00000000000 --- a/resource-manager/loadtestservice/2022-12-01/loadtests/model_loadtestresourcepatchrequestbody.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadtests - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadTestResourcePatchRequestBody struct { - Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` - Properties *LoadTestResourcePatchRequestBodyProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/loadtestservice/2022-12-01/loadtests/model_loadtestresourceupdate.go b/resource-manager/loadtestservice/2022-12-01/loadtests/model_loadtestresourceupdate.go new file mode 100644 index 00000000000..8eb181227cf --- /dev/null +++ b/resource-manager/loadtestservice/2022-12-01/loadtests/model_loadtestresourceupdate.go @@ -0,0 +1,14 @@ +package loadtests + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LoadTestResourceUpdate struct { + Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` + Properties *LoadTestResourceUpdateProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/loadtestservice/2022-12-01/loadtests/model_loadtestresourcepatchrequestbodyproperties.go b/resource-manager/loadtestservice/2022-12-01/loadtests/model_loadtestresourceupdateproperties.go similarity index 84% rename from resource-manager/loadtestservice/2022-12-01/loadtests/model_loadtestresourcepatchrequestbodyproperties.go rename to resource-manager/loadtestservice/2022-12-01/loadtests/model_loadtestresourceupdateproperties.go index f4d7aac60ce..e995382b650 100644 --- a/resource-manager/loadtestservice/2022-12-01/loadtests/model_loadtestresourcepatchrequestbodyproperties.go +++ b/resource-manager/loadtestservice/2022-12-01/loadtests/model_loadtestresourceupdateproperties.go @@ -3,7 +3,7 @@ package loadtests // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type LoadTestResourcePatchRequestBodyProperties struct { +type LoadTestResourceUpdateProperties struct { Description *string `json:"description,omitempty"` Encryption *EncryptionProperties `json:"encryption,omitempty"` } diff --git a/resource-manager/loadtestservice/2022-12-01/loadtest/model_outboundenvironmentendpoint.go b/resource-manager/loadtestservice/2022-12-01/loadtests/model_outboundenvironmentendpoint.go similarity index 94% rename from resource-manager/loadtestservice/2022-12-01/loadtest/model_outboundenvironmentendpoint.go rename to resource-manager/loadtestservice/2022-12-01/loadtests/model_outboundenvironmentendpoint.go index ef630fb25be..0a6c94d8d18 100644 --- a/resource-manager/loadtestservice/2022-12-01/loadtest/model_outboundenvironmentendpoint.go +++ b/resource-manager/loadtestservice/2022-12-01/loadtests/model_outboundenvironmentendpoint.go @@ -1,4 +1,4 @@ -package loadtest +package loadtests // 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/loadtestservice/2022-12-01/loadtests/predicates.go b/resource-manager/loadtestservice/2022-12-01/loadtests/predicates.go index da056c9b937..f8d0e293506 100644 --- a/resource-manager/loadtestservice/2022-12-01/loadtests/predicates.go +++ b/resource-manager/loadtestservice/2022-12-01/loadtests/predicates.go @@ -30,3 +30,16 @@ func (p LoadTestResourceOperationPredicate) Matches(input LoadTestResource) bool return true } + +type OutboundEnvironmentEndpointOperationPredicate struct { + Category *string +} + +func (p OutboundEnvironmentEndpointOperationPredicate) Matches(input OutboundEnvironmentEndpoint) bool { + + if p.Category != nil && (input.Category == nil || *p.Category != *input.Category) { + return false + } + + return true +} diff --git a/resource-manager/loadtestservice/2022-12-01/quotas/model_checkquotaavailabilityresponse.go b/resource-manager/loadtestservice/2022-12-01/quotas/model_checkquotaavailabilityresponse.go index b494c8c55f6..73ec3a857ec 100644 --- a/resource-manager/loadtestservice/2022-12-01/quotas/model_checkquotaavailabilityresponse.go +++ b/resource-manager/loadtestservice/2022-12-01/quotas/model_checkquotaavailabilityresponse.go @@ -8,9 +8,9 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type CheckQuotaAvailabilityResponse struct { - Id *string `json:"id,omitempty"` + Id string `json:"id"` Name *string `json:"name,omitempty"` Properties *CheckQuotaAvailabilityResponseProperties `json:"properties,omitempty"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` + Type string `json:"type"` } diff --git a/resource-manager/loadtestservice/2022-12-01/quotas/model_quotabucketrequest.go b/resource-manager/loadtestservice/2022-12-01/quotas/model_quotabucketrequest.go index 3d0162f3668..32b72ca4e5a 100644 --- a/resource-manager/loadtestservice/2022-12-01/quotas/model_quotabucketrequest.go +++ b/resource-manager/loadtestservice/2022-12-01/quotas/model_quotabucketrequest.go @@ -1,16 +1,8 @@ package quotas -import ( - "github.com/hashicorp/go-azure-helpers/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 QuotaBucketRequest struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` Properties *QuotaBucketRequestProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` }