diff --git a/internal/services/maps/sdk/2021-02-01/accounts/id_account_test.go b/internal/services/maps/sdk/2021-02-01/accounts/id_account_test.go deleted file mode 100644 index e5c49cbc5db5..000000000000 --- a/internal/services/maps/sdk/2021-02-01/accounts/id_account_test.go +++ /dev/null @@ -1,264 +0,0 @@ -package accounts - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = AccountId{} - -func TestNewAccountID(t *testing.T) { - id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - - if id.SubscriptionId != "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.AccountName != "accountValue" { - t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "accountValue") - } -} - -func TestFormatAccountID(t *testing.T) { - actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", actual, expected) - } -} - -func TestParseAccountID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AccountId - }{ - { - // 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.Maps", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue", - Expected: &AccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - AccountName: "accountValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAccountID(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.AccountName != v.Expected.AccountName { - t.Fatalf("Expected %q but got %q for AccountName", v.Expected.AccountName, actual.AccountName) - } - - } -} - -func TestParseAccountIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AccountId - }{ - { - // 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.Maps", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mApS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mApS/aCcOuNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue", - Expected: &AccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - AccountName: "accountValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mApS/aCcOuNtS/aCcOuNtVaLuE", - Expected: &AccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AccountName: "aCcOuNtVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mApS/aCcOuNtS/aCcOuNtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAccountIDInsensitively(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.AccountName != v.Expected.AccountName { - t.Fatalf("Expected %q but got %q for AccountName", v.Expected.AccountName, actual.AccountName) - } - - } -} diff --git a/internal/services/maps/sdk/2021-02-01/accounts/id_resourcegroup.go b/internal/services/maps/sdk/2021-02-01/accounts/id_resourcegroup.go deleted file mode 100644 index 701ad7475d26..000000000000 --- a/internal/services/maps/sdk/2021-02-01/accounts/id_resourcegroup.go +++ /dev/null @@ -1,109 +0,0 @@ -package accounts - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = ResourceGroupId{} - -// ResourceGroupId is a struct representing the Resource ID for a Resource Group -type ResourceGroupId struct { - SubscriptionId string - ResourceGroupName string -} - -// NewResourceGroupID returns a new ResourceGroupId struct -func NewResourceGroupID(subscriptionId string, resourceGroupName string) ResourceGroupId { - return ResourceGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - } -} - -// ParseResourceGroupID parses 'input' into a ResourceGroupId -func ParseResourceGroupID(input string) (*ResourceGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(ResourceGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ResourceGroupId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseResourceGroupIDInsensitively parses 'input' case-insensitively into a ResourceGroupId -// note: this method should only be used for API response data and not user input -func ParseResourceGroupIDInsensitively(input string) (*ResourceGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(ResourceGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := ResourceGroupId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateResourceGroupID checks that 'input' can be parsed as a Resource Group ID -func ValidateResourceGroupID(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 := ParseResourceGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Resource Group ID -func (id ResourceGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Resource Group ID -func (id ResourceGroupId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - } -} - -// String returns a human-readable description of this Resource Group ID -func (id ResourceGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - } - return fmt.Sprintf("Resource Group (%s)", strings.Join(components, "\n")) -} diff --git a/internal/services/maps/sdk/2021-02-01/accounts/id_resourcegroup_test.go b/internal/services/maps/sdk/2021-02-01/accounts/id_resourcegroup_test.go deleted file mode 100644 index c4a6f235ea46..000000000000 --- a/internal/services/maps/sdk/2021-02-01/accounts/id_resourcegroup_test.go +++ /dev/null @@ -1,189 +0,0 @@ -package accounts - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = ResourceGroupId{} - -func TestNewResourceGroupID(t *testing.T) { - id := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-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") - } - - if id.ResourceGroupName != "example-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") - } -} - -func TestFormatResourceGroupID(t *testing.T) { - actual := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", actual, expected) - } -} - -func TestParseResourceGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ResourceGroupId - }{ - { - // 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, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", - Expected: &ResourceGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseResourceGroupID(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) - } - - } -} - -func TestParseResourceGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ResourceGroupId - }{ - { - // 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, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", - Expected: &ResourceGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", - Expected: &ResourceGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseResourceGroupIDInsensitively(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) - } - - } -} diff --git a/internal/services/maps/sdk/2021-02-01/accounts/id_subscription.go b/internal/services/maps/sdk/2021-02-01/accounts/id_subscription.go deleted file mode 100644 index f95107ae71d3..000000000000 --- a/internal/services/maps/sdk/2021-02-01/accounts/id_subscription.go +++ /dev/null @@ -1,96 +0,0 @@ -package accounts - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = SubscriptionId{} - -// SubscriptionId is a struct representing the Resource ID for a Subscription -type SubscriptionId struct { - SubscriptionId string -} - -// NewSubscriptionID returns a new SubscriptionId struct -func NewSubscriptionID(subscriptionId string) SubscriptionId { - return SubscriptionId{ - SubscriptionId: subscriptionId, - } -} - -// ParseSubscriptionID parses 'input' into a SubscriptionId -func ParseSubscriptionID(input string) (*SubscriptionId, error) { - parser := resourceids.NewParserFromResourceIdType(SubscriptionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := SubscriptionId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseSubscriptionIDInsensitively parses 'input' case-insensitively into a SubscriptionId -// note: this method should only be used for API response data and not user input -func ParseSubscriptionIDInsensitively(input string) (*SubscriptionId, error) { - parser := resourceids.NewParserFromResourceIdType(SubscriptionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := SubscriptionId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateSubscriptionID checks that 'input' can be parsed as a Subscription ID -func ValidateSubscriptionID(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 := ParseSubscriptionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Subscription ID -func (id SubscriptionId) ID() string { - fmtString := "/subscriptions/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Subscription ID -func (id SubscriptionId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - } -} - -// String returns a human-readable description of this Subscription ID -func (id SubscriptionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - } - return fmt.Sprintf("Subscription (%s)", strings.Join(components, "\n")) -} diff --git a/internal/services/maps/sdk/2021-02-01/accounts/id_subscription_test.go b/internal/services/maps/sdk/2021-02-01/accounts/id_subscription_test.go deleted file mode 100644 index 7f03b066d161..000000000000 --- a/internal/services/maps/sdk/2021-02-01/accounts/id_subscription_test.go +++ /dev/null @@ -1,144 +0,0 @@ -package accounts - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = SubscriptionId{} - -func TestNewSubscriptionID(t *testing.T) { - id := NewSubscriptionID("12345678-1234-9876-4563-123456789012") - - if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") - } -} - -func TestFormatSubscriptionID(t *testing.T) { - actual := NewSubscriptionID("12345678-1234-9876-4563-123456789012").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", actual, expected) - } -} - -func TestParseSubscriptionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SubscriptionId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Expected: &SubscriptionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSubscriptionID(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) - } - - } -} - -func TestParseSubscriptionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SubscriptionId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Expected: &SubscriptionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", - Expected: &SubscriptionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSubscriptionIDInsensitively(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) - } - - } -} diff --git a/internal/services/maps/sdk/2021-02-01/accounts/model_mapskeyspecification.go b/internal/services/maps/sdk/2021-02-01/accounts/model_mapskeyspecification.go deleted file mode 100644 index 346328840c34..000000000000 --- a/internal/services/maps/sdk/2021-02-01/accounts/model_mapskeyspecification.go +++ /dev/null @@ -1,5 +0,0 @@ -package accounts - -type MapsKeySpecification struct { - KeyType KeyType `json:"keyType"` -} diff --git a/internal/services/maps/sdk/2021-02-01/accounts/model_sku.go b/internal/services/maps/sdk/2021-02-01/accounts/model_sku.go deleted file mode 100644 index 213db573ebff..000000000000 --- a/internal/services/maps/sdk/2021-02-01/accounts/model_sku.go +++ /dev/null @@ -1,6 +0,0 @@ -package accounts - -type Sku struct { - Name Name `json:"name"` - Tier *string `json:"tier,omitempty"` -} diff --git a/internal/services/maps/sdk/2021-02-01/accounts/model_systemdata.go b/internal/services/maps/sdk/2021-02-01/accounts/model_systemdata.go deleted file mode 100644 index 8bc1758a073f..000000000000 --- a/internal/services/maps/sdk/2021-02-01/accounts/model_systemdata.go +++ /dev/null @@ -1,10 +0,0 @@ -package accounts - -type SystemData struct { - CreatedAt *string `json:"createdAt,omitempty"` - CreatedBy *string `json:"createdBy,omitempty"` - CreatedByType *CreatedByType `json:"createdByType,omitempty"` - LastModifiedAt *string `json:"lastModifiedAt,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` -} diff --git a/internal/services/maps/sdk/2021-02-01/accounts/version.go b/internal/services/maps/sdk/2021-02-01/accounts/version.go deleted file mode 100644 index 61fb0715ae52..000000000000 --- a/internal/services/maps/sdk/2021-02-01/accounts/version.go +++ /dev/null @@ -1,9 +0,0 @@ -package accounts - -import "fmt" - -const defaultApiVersion = "2021-02-01" - -func userAgent() string { - return fmt.Sprintf("pandora/accounts/%s", defaultApiVersion) -} diff --git a/internal/services/maps/sdk/2021-02-01/creators/id_account_test.go b/internal/services/maps/sdk/2021-02-01/creators/id_account_test.go deleted file mode 100644 index 5422e848448a..000000000000 --- a/internal/services/maps/sdk/2021-02-01/creators/id_account_test.go +++ /dev/null @@ -1,264 +0,0 @@ -package creators - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = AccountId{} - -func TestNewAccountID(t *testing.T) { - id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - - if id.SubscriptionId != "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.AccountName != "accountValue" { - t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "accountValue") - } -} - -func TestFormatAccountID(t *testing.T) { - actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", actual, expected) - } -} - -func TestParseAccountID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AccountId - }{ - { - // 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.Maps", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue", - Expected: &AccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - AccountName: "accountValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAccountID(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.AccountName != v.Expected.AccountName { - t.Fatalf("Expected %q but got %q for AccountName", v.Expected.AccountName, actual.AccountName) - } - - } -} - -func TestParseAccountIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AccountId - }{ - { - // 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.Maps", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mApS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mApS/aCcOuNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue", - Expected: &AccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - AccountName: "accountValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mApS/aCcOuNtS/aCcOuNtVaLuE", - Expected: &AccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AccountName: "aCcOuNtVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mApS/aCcOuNtS/aCcOuNtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAccountIDInsensitively(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.AccountName != v.Expected.AccountName { - t.Fatalf("Expected %q but got %q for AccountName", v.Expected.AccountName, actual.AccountName) - } - - } -} diff --git a/internal/services/maps/sdk/2021-02-01/creators/id_creator_test.go b/internal/services/maps/sdk/2021-02-01/creators/id_creator_test.go deleted file mode 100644 index 85b3f826e2c1..000000000000 --- a/internal/services/maps/sdk/2021-02-01/creators/id_creator_test.go +++ /dev/null @@ -1,309 +0,0 @@ -package creators - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = CreatorId{} - -func TestNewCreatorID(t *testing.T) { - id := NewCreatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "creatorValue") - - if id.SubscriptionId != "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.AccountName != "accountValue" { - t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "accountValue") - } - - if id.CreatorName != "creatorValue" { - t.Fatalf("Expected %q but got %q for Segment 'CreatorName'", id.CreatorName, "creatorValue") - } -} - -func TestFormatCreatorID(t *testing.T) { - actual := NewCreatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "creatorValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue/creators/creatorValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", actual, expected) - } -} - -func TestParseCreatorID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CreatorId - }{ - { - // 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.Maps", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue/creators", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue/creators/creatorValue", - Expected: &CreatorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - AccountName: "accountValue", - CreatorName: "creatorValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue/creators/creatorValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCreatorID(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.AccountName != v.Expected.AccountName { - t.Fatalf("Expected %q but got %q for AccountName", v.Expected.AccountName, actual.AccountName) - } - - if actual.CreatorName != v.Expected.CreatorName { - t.Fatalf("Expected %q but got %q for CreatorName", v.Expected.CreatorName, actual.CreatorName) - } - - } -} - -func TestParseCreatorIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CreatorId - }{ - { - // 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.Maps", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mApS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mApS/aCcOuNtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mApS/aCcOuNtS/aCcOuNtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue/creators", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mApS/aCcOuNtS/aCcOuNtVaLuE/cReAtOrS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue/creators/creatorValue", - Expected: &CreatorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - AccountName: "accountValue", - CreatorName: "creatorValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maps/accounts/accountValue/creators/creatorValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mApS/aCcOuNtS/aCcOuNtVaLuE/cReAtOrS/cReAtOrVaLuE", - Expected: &CreatorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AccountName: "aCcOuNtVaLuE", - CreatorName: "cReAtOrVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mApS/aCcOuNtS/aCcOuNtVaLuE/cReAtOrS/cReAtOrVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCreatorIDInsensitively(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.AccountName != v.Expected.AccountName { - t.Fatalf("Expected %q but got %q for AccountName", v.Expected.AccountName, actual.AccountName) - } - - if actual.CreatorName != v.Expected.CreatorName { - t.Fatalf("Expected %q but got %q for CreatorName", v.Expected.CreatorName, actual.CreatorName) - } - - } -} diff --git a/internal/services/maps/sdk/2021-02-01/creators/version.go b/internal/services/maps/sdk/2021-02-01/creators/version.go deleted file mode 100644 index a938be04aeb5..000000000000 --- a/internal/services/maps/sdk/2021-02-01/creators/version.go +++ /dev/null @@ -1,9 +0,0 @@ -package creators - -import "fmt" - -const defaultApiVersion = "2021-02-01" - -func userAgent() string { - return fmt.Sprintf("pandora/creators/%s", defaultApiVersion) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/CHANGELOG.md deleted file mode 100644 index 52911e4cc5e4..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/_meta.json deleted file mode 100644 index aded6d82464a..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "c2ea3a3ccd14293b4bd1d17e684ef9129f0dc604", - "readme": "/_/azure-rest-api-specs/specification/maps/resource-manager/readme.md", - "tag": "package-2021-02", - "use": "@microsoft.azure/autorest.go@2.1.187", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-02 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/maps/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" - } -} \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/accounts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/accounts.go deleted file mode 100644 index ddf78f1bf027..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/accounts.go +++ /dev/null @@ -1,808 +0,0 @@ -package maps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AccountsClient is the azure Maps -type AccountsClient struct { - BaseClient -} - -// NewAccountsClient creates an instance of the AccountsClient client. -func NewAccountsClient(subscriptionID string) AccountsClient { - return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAccountsClientWithBaseURI creates an instance of the AccountsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { - return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps REST -// APIs. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// accountName - the name of the Maps Account. -// mapsAccount - the new or updated parameters for the Maps Account. -func (client AccountsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, mapsAccount Account) (result Account, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: mapsAccount, - Constraints: []validation.Constraint{{Target: "mapsAccount.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("maps.AccountsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, mapsAccount) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AccountsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, mapsAccount Account) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - mapsAccount.SystemData = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}", pathParameters), - autorest.WithJSON(mapsAccount), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client AccountsClient) CreateOrUpdateResponder(resp *http.Response) (result Account, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a Maps Account. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// accountName - the name of the Maps Account. -func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("maps.AccountsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client AccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get a Maps Account. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// accountName - the name of the Maps Account. -func (client AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("maps.AccountsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AccountsClient) GetResponder(resp *http.Response) (result Account, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup get all Maps Accounts in a Resource Group -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountsPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.a.Response.Response != nil { - sc = result.a.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("maps.AccountsClient", "ListByResourceGroup", err.Error()) - } - - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.a.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.a, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.a.hasNextLink() && result.a.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client AccountsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) (result Accounts, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client AccountsClient) listByResourceGroupNextResults(ctx context.Context, lastResults Accounts) (result Accounts, err error) { - req, err := lastResults.accountsPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "maps.AccountsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "maps.AccountsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client AccountsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AccountsIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription get all Maps Accounts in a Subscription -func (client AccountsClient) ListBySubscription(ctx context.Context) (result AccountsPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription") - defer func() { - sc := -1 - if result.a.Response.Response != nil { - sc = result.a.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("maps.AccountsClient", "ListBySubscription", err.Error()) - } - - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.a.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.a, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.a.hasNextLink() && result.a.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client AccountsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Maps/accounts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client AccountsClient) ListBySubscriptionResponder(resp *http.Response) (result Accounts, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client AccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults Accounts) (result Accounts, err error) { - req, err := lastResults.accountsPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "maps.AccountsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "maps.AccountsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AccountsClient) ListBySubscriptionComplete(ctx context.Context) (result AccountsIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// ListKeys get the keys to use with the Maps APIs. A key is used to authenticate and authorize access to the Maps REST -// APIs. Only one key is needed at a time; two are given to provide seamless key regeneration. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// accountName - the name of the Maps Account. -func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result AccountKeys, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListKeys") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("maps.AccountsClient", "ListKeys", err.Error()) - } - - req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListKeys", nil, "Failure preparing request") - return - } - - resp, err := client.ListKeysSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListKeys", resp, "Failure sending request") - return - } - - result, err = client.ListKeysResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListKeys", resp, "Failure responding to request") - return - } - - return -} - -// ListKeysPreparer prepares the ListKeys request. -func (client AccountsClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/listKeys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListKeysSender sends the ListKeys request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) ListKeysSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListKeysResponder handles the response to the ListKeys request. The method always -// closes the http.Response Body. -func (client AccountsClient) ListKeysResponder(resp *http.Response) (result AccountKeys, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// RegenerateKeys regenerate either the primary or secondary key for use with the Maps APIs. The old key will stop -// working immediately. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// accountName - the name of the Maps Account. -// keySpecification - which key to regenerate: primary or secondary. -func (client AccountsClient) RegenerateKeys(ctx context.Context, resourceGroupName string, accountName string, keySpecification KeySpecification) (result AccountKeys, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.RegenerateKeys") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("maps.AccountsClient", "RegenerateKeys", err.Error()) - } - - req, err := client.RegenerateKeysPreparer(ctx, resourceGroupName, accountName, keySpecification) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "RegenerateKeys", nil, "Failure preparing request") - return - } - - resp, err := client.RegenerateKeysSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "RegenerateKeys", resp, "Failure sending request") - return - } - - result, err = client.RegenerateKeysResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "RegenerateKeys", resp, "Failure responding to request") - return - } - - return -} - -// RegenerateKeysPreparer prepares the RegenerateKeys request. -func (client AccountsClient) RegenerateKeysPreparer(ctx context.Context, resourceGroupName string, accountName string, keySpecification KeySpecification) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/regenerateKey", pathParameters), - autorest.WithJSON(keySpecification), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RegenerateKeysSender sends the RegenerateKeys request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) RegenerateKeysSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// RegenerateKeysResponder handles the response to the RegenerateKeys request. The method always -// closes the http.Response Body. -func (client AccountsClient) RegenerateKeysResponder(resp *http.Response) (result AccountKeys, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update updates a Maps Account. Only a subset of the parameters may be updated after creation, such as Sku, Tags, -// Properties. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// accountName - the name of the Maps Account. -// mapsAccountUpdateParameters - the updated parameters for the Maps Account. -func (client AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, mapsAccountUpdateParameters AccountUpdateParameters) (result Account, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("maps.AccountsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, mapsAccountUpdateParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client AccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, mapsAccountUpdateParameters AccountUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}", pathParameters), - autorest.WithJSON(mapsAccountUpdateParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client AccountsClient) UpdateResponder(resp *http.Response) (result Account, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/client.go deleted file mode 100644 index c452debd4ece..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/client.go +++ /dev/null @@ -1,41 +0,0 @@ -// Package maps implements the Azure ARM Maps service API version 2021-02-01. -// -// Azure Maps -package maps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "github.com/Azure/go-autorest/autorest" -) - -const ( - // DefaultBaseURI is the default URI used for the service Maps - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Maps. -type BaseClient struct { - autorest.Client - BaseURI string - SubscriptionID string -} - -// New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/creators.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/creators.go deleted file mode 100644 index 77a7d495dd26..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/creators.go +++ /dev/null @@ -1,526 +0,0 @@ -package maps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CreatorsClient is the azure Maps -type CreatorsClient struct { - BaseClient -} - -// NewCreatorsClient creates an instance of the CreatorsClient client. -func NewCreatorsClient(subscriptionID string) CreatorsClient { - return NewCreatorsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCreatorsClientWithBaseURI creates an instance of the CreatorsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewCreatorsClientWithBaseURI(baseURI string, subscriptionID string) CreatorsClient { - return CreatorsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a Maps Creator resource. Creator resource will manage Azure resources required to -// populate a custom set of mapping data. It requires an account to exist before it can be created. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// accountName - the name of the Maps Account. -// creatorName - the name of the Maps Creator instance. -// creatorResource - the new or updated parameters for the Creator resource. -func (client CreatorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, creatorName string, creatorResource Creator) (result Creator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CreatorsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: creatorResource, - Constraints: []validation.Constraint{{Target: "creatorResource.Properties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "creatorResource.Properties.StorageUnits", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "creatorResource.Properties.StorageUnits", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "creatorResource.Properties.StorageUnits", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("maps.CreatorsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, creatorName, creatorResource) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client CreatorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, creatorName string, creatorResource Creator) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "creatorName": autorest.Encode("path", creatorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}", pathParameters), - autorest.WithJSON(creatorResource), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client CreatorsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client CreatorsClient) CreateOrUpdateResponder(resp *http.Response) (result Creator, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a Maps Creator resource. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// accountName - the name of the Maps Account. -// creatorName - the name of the Maps Creator instance. -func (client CreatorsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, creatorName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CreatorsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("maps.CreatorsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, creatorName) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CreatorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, creatorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "creatorName": autorest.Encode("path", creatorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client CreatorsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client CreatorsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get a Maps Creator resource. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// accountName - the name of the Maps Account. -// creatorName - the name of the Maps Creator instance. -func (client CreatorsClient) Get(ctx context.Context, resourceGroupName string, accountName string, creatorName string) (result Creator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CreatorsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("maps.CreatorsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, accountName, creatorName) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CreatorsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, creatorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "creatorName": autorest.Encode("path", creatorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client CreatorsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CreatorsClient) GetResponder(resp *http.Response) (result Creator, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAccount get all Creator instances for an Azure Maps Account -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// accountName - the name of the Maps Account. -func (client CreatorsClient) ListByAccount(ctx context.Context, resourceGroupName string, accountName string) (result CreatorListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CreatorsClient.ListByAccount") - defer func() { - sc := -1 - if result.cl.Response.Response != nil { - sc = result.cl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("maps.CreatorsClient", "ListByAccount", err.Error()) - } - - result.fn = client.listByAccountNextResults - req, err := client.ListByAccountPreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "ListByAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAccountSender(req) - if err != nil { - result.cl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "ListByAccount", resp, "Failure sending request") - return - } - - result.cl, err = client.ListByAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "ListByAccount", resp, "Failure responding to request") - return - } - if result.cl.hasNextLink() && result.cl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAccountPreparer prepares the ListByAccount request. -func (client CreatorsClient) ListByAccountPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAccountSender sends the ListByAccount request. The method will close the -// http.Response Body if it receives an error. -func (client CreatorsClient) ListByAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAccountResponder handles the response to the ListByAccount request. The method always -// closes the http.Response Body. -func (client CreatorsClient) ListByAccountResponder(resp *http.Response) (result CreatorList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAccountNextResults retrieves the next set of results, if any. -func (client CreatorsClient) listByAccountNextResults(ctx context.Context, lastResults CreatorList) (result CreatorList, err error) { - req, err := lastResults.creatorListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "maps.CreatorsClient", "listByAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "maps.CreatorsClient", "listByAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "listByAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client CreatorsClient) ListByAccountComplete(ctx context.Context, resourceGroupName string, accountName string) (result CreatorListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CreatorsClient.ListByAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAccount(ctx, resourceGroupName, accountName) - return -} - -// Update updates the Maps Creator resource. Only a subset of the parameters may be updated after creation, such as -// Tags. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// accountName - the name of the Maps Account. -// creatorName - the name of the Maps Creator instance. -// creatorUpdateParameters - the update parameters for Maps Creator. -func (client CreatorsClient) Update(ctx context.Context, resourceGroupName string, accountName string, creatorName string, creatorUpdateParameters CreatorUpdateParameters) (result Creator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CreatorsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("maps.CreatorsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, creatorName, creatorUpdateParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client CreatorsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, creatorName string, creatorUpdateParameters CreatorUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "creatorName": autorest.Encode("path", creatorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}", pathParameters), - autorest.WithJSON(creatorUpdateParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client CreatorsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client CreatorsClient) UpdateResponder(resp *http.Response) (result Creator, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/enums.go deleted file mode 100644 index d1a4911414e4..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/enums.go +++ /dev/null @@ -1,73 +0,0 @@ -package maps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// CreatedByType enumerates the values for created by type. -type CreatedByType string - -const ( - // CreatedByTypeApplication ... - CreatedByTypeApplication CreatedByType = "Application" - // CreatedByTypeKey ... - CreatedByTypeKey CreatedByType = "Key" - // CreatedByTypeManagedIdentity ... - CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - // CreatedByTypeUser ... - CreatedByTypeUser CreatedByType = "User" -) - -// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. -func PossibleCreatedByTypeValues() []CreatedByType { - return []CreatedByType{CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser} -} - -// KeyType enumerates the values for key type. -type KeyType string - -const ( - // KeyTypePrimary ... - KeyTypePrimary KeyType = "primary" - // KeyTypeSecondary ... - KeyTypeSecondary KeyType = "secondary" -) - -// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. -func PossibleKeyTypeValues() []KeyType { - return []KeyType{KeyTypePrimary, KeyTypeSecondary} -} - -// Kind enumerates the values for kind. -type Kind string - -const ( - // KindGen1 ... - KindGen1 Kind = "Gen1" - // KindGen2 ... - KindGen2 Kind = "Gen2" -) - -// PossibleKindValues returns an array of possible values for the Kind const type. -func PossibleKindValues() []Kind { - return []Kind{KindGen1, KindGen2} -} - -// Name enumerates the values for name. -type Name string - -const ( - // NameG2 ... - NameG2 Name = "G2" - // NameS0 ... - NameS0 Name = "S0" - // NameS1 ... - NameS1 Name = "S1" -) - -// PossibleNameValues returns an array of possible values for the Name const type. -func PossibleNameValues() []Name { - return []Name{NameG2, NameS0, NameS1} -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/maps.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/maps.go deleted file mode 100644 index b21469c5c483..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/maps.go +++ /dev/null @@ -1,140 +0,0 @@ -package maps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// Client is the azure Maps -type Client struct { - BaseClient -} - -// NewClient creates an instance of the Client client. -func NewClient(subscriptionID string) Client { - return NewClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewClientWithBaseURI creates an instance of the Client client using a custom endpoint. Use this when interacting -// with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { - return Client{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListOperations list operations available for the Maps Resource Provider -func (client Client) ListOperations(ctx context.Context) (result OperationsPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListOperations") - defer func() { - sc := -1 - if result.o.Response.Response != nil { - sc = result.o.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listOperationsNextResults - req, err := client.ListOperationsPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.Client", "ListOperations", nil, "Failure preparing request") - return - } - - resp, err := client.ListOperationsSender(req) - if err != nil { - result.o.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "maps.Client", "ListOperations", resp, "Failure sending request") - return - } - - result.o, err = client.ListOperationsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.Client", "ListOperations", resp, "Failure responding to request") - return - } - if result.o.hasNextLink() && result.o.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListOperationsPreparer prepares the ListOperations request. -func (client Client) ListOperationsPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2021-02-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Maps/operations"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListOperationsSender sends the ListOperations request. The method will close the -// http.Response Body if it receives an error. -func (client Client) ListOperationsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListOperationsResponder handles the response to the ListOperations request. The method always -// closes the http.Response Body. -func (client Client) ListOperationsResponder(resp *http.Response) (result Operations, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listOperationsNextResults retrieves the next set of results, if any. -func (client Client) listOperationsNextResults(ctx context.Context, lastResults Operations) (result Operations, err error) { - req, err := lastResults.operationsPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "maps.Client", "listOperationsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListOperationsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "maps.Client", "listOperationsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListOperationsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.Client", "listOperationsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListOperationsComplete enumerates all values, automatically crossing page boundaries as required. -func (client Client) ListOperationsComplete(ctx context.Context) (result OperationsIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListOperations") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListOperations(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/models.go deleted file mode 100644 index 4d46e3d35947..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/models.go +++ /dev/null @@ -1,1101 +0,0 @@ -package maps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps" - -// Account an Azure resource which represents access to a suite of Maps REST APIs. -type Account struct { - autorest.Response `json:"-"` - // Sku - The SKU of this account. - Sku *Sku `json:"sku,omitempty"` - // Kind - Get or Set Kind property. Possible values include: 'KindGen1', 'KindGen2' - Kind Kind `json:"kind,omitempty"` - // SystemData - READ-ONLY; The system meta data relating to this resource. - SystemData *SystemData `json:"systemData,omitempty"` - // Properties - The map account properties. - Properties *AccountProperties `json:"properties,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Account. -func (a Account) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if a.Sku != nil { - objectMap["sku"] = a.Sku - } - if a.Kind != "" { - objectMap["kind"] = a.Kind - } - if a.Properties != nil { - objectMap["properties"] = a.Properties - } - if a.Tags != nil { - objectMap["tags"] = a.Tags - } - if a.Location != nil { - objectMap["location"] = a.Location - } - return json.Marshal(objectMap) -} - -// AccountKeys the set of keys which can be used to access the Maps REST APIs. Two keys are provided for -// key rotation without interruption. -type AccountKeys struct { - autorest.Response `json:"-"` - // PrimaryKeyLastUpdated - READ-ONLY; The last updated date and time of the primary key. - PrimaryKeyLastUpdated *string `json:"primaryKeyLastUpdated,omitempty"` - // PrimaryKey - READ-ONLY; The primary key for accessing the Maps REST APIs. - PrimaryKey *string `json:"primaryKey,omitempty"` - // SecondaryKey - READ-ONLY; The secondary key for accessing the Maps REST APIs. - SecondaryKey *string `json:"secondaryKey,omitempty"` - // SecondaryKeyLastUpdated - READ-ONLY; The last updated date and time of the secondary key. - SecondaryKeyLastUpdated *string `json:"secondaryKeyLastUpdated,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccountKeys. -func (ak AccountKeys) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// AccountProperties additional Map account properties -type AccountProperties struct { - // UniqueID - READ-ONLY; A unique identifier for the maps account - UniqueID *string `json:"uniqueId,omitempty"` - // DisableLocalAuth - Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys authentication from any usage. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - // ProvisioningState - READ-ONLY; the state of the provisioning. - ProvisioningState *string `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccountProperties. -func (ap AccountProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ap.DisableLocalAuth != nil { - objectMap["disableLocalAuth"] = ap.DisableLocalAuth - } - return json.Marshal(objectMap) -} - -// Accounts a list of Maps Accounts. -type Accounts struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; a Maps Account. - Value *[]Account `json:"value,omitempty"` - // NextLink - URL client should use to fetch the next page (per server side paging). - // It's null for now, added for future use. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for Accounts. -func (a Accounts) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if a.NextLink != nil { - objectMap["nextLink"] = a.NextLink - } - return json.Marshal(objectMap) -} - -// AccountsIterator provides access to a complete listing of Account values. -type AccountsIterator struct { - i int - page AccountsPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AccountsIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AccountsIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AccountsIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AccountsIterator) Response() Accounts { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AccountsIterator) Value() Account { - if !iter.page.NotDone() { - return Account{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AccountsIterator type. -func NewAccountsIterator(page AccountsPage) AccountsIterator { - return AccountsIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (a Accounts) IsEmpty() bool { - return a.Value == nil || len(*a.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (a Accounts) hasNextLink() bool { - return a.NextLink != nil && len(*a.NextLink) != 0 -} - -// accountsPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (a Accounts) accountsPreparer(ctx context.Context) (*http.Request, error) { - if !a.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(a.NextLink))) -} - -// AccountsPage contains a page of Account values. -type AccountsPage struct { - fn func(context.Context, Accounts) (Accounts, error) - a Accounts -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AccountsPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.a) - if err != nil { - return err - } - page.a = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AccountsPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AccountsPage) NotDone() bool { - return !page.a.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AccountsPage) Response() Accounts { - return page.a -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AccountsPage) Values() []Account { - if page.a.IsEmpty() { - return nil - } - return *page.a.Value -} - -// Creates a new instance of the AccountsPage type. -func NewAccountsPage(cur Accounts, getNextPage func(context.Context, Accounts) (Accounts, error)) AccountsPage { - return AccountsPage{ - fn: getNextPage, - a: cur, - } -} - -// AccountUpdateParameters parameters used to update an existing Maps Account. -type AccountUpdateParameters struct { - // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. - Tags map[string]*string `json:"tags"` - // Kind - Get or Set Kind property. Possible values include: 'KindGen1', 'KindGen2' - Kind Kind `json:"kind,omitempty"` - // Sku - The SKU of this account. - Sku *Sku `json:"sku,omitempty"` - // AccountProperties - The map account properties. - *AccountProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccountUpdateParameters. -func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aup.Tags != nil { - objectMap["tags"] = aup.Tags - } - if aup.Kind != "" { - objectMap["kind"] = aup.Kind - } - if aup.Sku != nil { - objectMap["sku"] = aup.Sku - } - if aup.AccountProperties != nil { - objectMap["properties"] = aup.AccountProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AccountUpdateParameters struct. -func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - aup.Tags = tags - } - case "kind": - if v != nil { - var kind Kind - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - aup.Kind = kind - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - aup.Sku = &sku - } - case "properties": - if v != nil { - var accountProperties AccountProperties - err = json.Unmarshal(*v, &accountProperties) - if err != nil { - return err - } - aup.AccountProperties = &accountProperties - } - } - } - - return nil -} - -// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. -type AzureEntityResource struct { - // Etag - READ-ONLY; Resource Etag. - Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureEntityResource. -func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// Creator an Azure resource which represents Maps Creator product and provides ability to manage private -// location data. -type Creator struct { - autorest.Response `json:"-"` - // Properties - The Creator resource properties. - Properties *CreatorProperties `json:"properties,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Creator. -func (c Creator) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.Properties != nil { - objectMap["properties"] = c.Properties - } - if c.Tags != nil { - objectMap["tags"] = c.Tags - } - if c.Location != nil { - objectMap["location"] = c.Location - } - return json.Marshal(objectMap) -} - -// CreatorList a list of Creator resources. -type CreatorList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; a Creator account. - Value *[]Creator `json:"value,omitempty"` - // NextLink - URL client should use to fetch the next page (per server side paging). - // It's null for now, added for future use. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for CreatorList. -func (cl CreatorList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cl.NextLink != nil { - objectMap["nextLink"] = cl.NextLink - } - return json.Marshal(objectMap) -} - -// CreatorListIterator provides access to a complete listing of Creator values. -type CreatorListIterator struct { - i int - page CreatorListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CreatorListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CreatorListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CreatorListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CreatorListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter CreatorListIterator) Response() CreatorList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter CreatorListIterator) Value() Creator { - if !iter.page.NotDone() { - return Creator{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CreatorListIterator type. -func NewCreatorListIterator(page CreatorListPage) CreatorListIterator { - return CreatorListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cl CreatorList) IsEmpty() bool { - return cl.Value == nil || len(*cl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cl CreatorList) hasNextLink() bool { - return cl.NextLink != nil && len(*cl.NextLink) != 0 -} - -// creatorListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cl CreatorList) creatorListPreparer(ctx context.Context) (*http.Request, error) { - if !cl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cl.NextLink))) -} - -// CreatorListPage contains a page of Creator values. -type CreatorListPage struct { - fn func(context.Context, CreatorList) (CreatorList, error) - cl CreatorList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CreatorListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CreatorListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cl) - if err != nil { - return err - } - page.cl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CreatorListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CreatorListPage) NotDone() bool { - return !page.cl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CreatorListPage) Response() CreatorList { - return page.cl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CreatorListPage) Values() []Creator { - if page.cl.IsEmpty() { - return nil - } - return *page.cl.Value -} - -// Creates a new instance of the CreatorListPage type. -func NewCreatorListPage(cur CreatorList, getNextPage func(context.Context, CreatorList) (CreatorList, error)) CreatorListPage { - return CreatorListPage{ - fn: getNextPage, - cl: cur, - } -} - -// CreatorProperties creator resource properties -type CreatorProperties struct { - // ProvisioningState - READ-ONLY; The state of the resource provisioning, terminal states: Succeeded, Failed, Canceled - ProvisioningState *string `json:"provisioningState,omitempty"` - // StorageUnits - The storage units to be allocated. Integer values from 1 to 100, inclusive. - StorageUnits *int32 `json:"storageUnits,omitempty"` -} - -// MarshalJSON is the custom marshaler for CreatorProperties. -func (cp CreatorProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cp.StorageUnits != nil { - objectMap["storageUnits"] = cp.StorageUnits - } - return json.Marshal(objectMap) -} - -// CreatorUpdateParameters parameters used to update an existing Creator resource. -type CreatorUpdateParameters struct { - // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. - Tags map[string]*string `json:"tags"` - // CreatorProperties - Creator resource properties. - *CreatorProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for CreatorUpdateParameters. -func (cup CreatorUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cup.Tags != nil { - objectMap["tags"] = cup.Tags - } - if cup.CreatorProperties != nil { - objectMap["properties"] = cup.CreatorProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CreatorUpdateParameters struct. -func (cup *CreatorUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cup.Tags = tags - } - case "properties": - if v != nil { - var creatorProperties CreatorProperties - err = json.Unmarshal(*v, &creatorProperties) - if err != nil { - return err - } - cup.CreatorProperties = &creatorProperties - } - } - } - - return nil -} - -// Dimension dimension of map account, for example API Category, Api Name, Result Type, and Response Code. -type Dimension struct { - // Name - Display name of dimension. - Name *string `json:"name,omitempty"` - // DisplayName - Display name of dimension. - DisplayName *string `json:"displayName,omitempty"` -} - -// ErrorAdditionalInfo the resource management error additional info. -type ErrorAdditionalInfo struct { - // Type - READ-ONLY; The additional info type. - Type *string `json:"type,omitempty"` - // Info - READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. -func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ErrorDetail the error detail. -type ErrorDetail struct { - // Code - READ-ONLY; The error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; The error message. - Message *string `json:"message,omitempty"` - // Target - READ-ONLY; The error target. - Target *string `json:"target,omitempty"` - // Details - READ-ONLY; The error details. - Details *[]ErrorDetail `json:"details,omitempty"` - // AdditionalInfo - READ-ONLY; The error additional info. - AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorDetail. -func (ed ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for -// failed operations. (This also follows the OData error response format.). -type ErrorResponse struct { - // Error - The error object. - Error *ErrorDetail `json:"error,omitempty"` -} - -// KeySpecification whether the operation refers to the primary or secondary key. -type KeySpecification struct { - // KeyType - Whether the operation refers to the primary or secondary key. Possible values include: 'KeyTypePrimary', 'KeyTypeSecondary' - KeyType KeyType `json:"keyType,omitempty"` -} - -// MetricSpecification metric specification of operation. -type MetricSpecification struct { - // Name - Name of metric specification. - Name *string `json:"name,omitempty"` - // DisplayName - Display name of metric specification. - DisplayName *string `json:"displayName,omitempty"` - // DisplayDescription - Display description of metric specification. - DisplayDescription *string `json:"displayDescription,omitempty"` - // Unit - Unit could be Count. - Unit *string `json:"unit,omitempty"` - // Dimensions - Dimensions of map account. - Dimensions *[]Dimension `json:"dimensions,omitempty"` - // AggregationType - Aggregation type could be Average. - AggregationType *string `json:"aggregationType,omitempty"` - // FillGapWithZero - The property to decide fill gap with zero or not. - FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` - // Category - The category this metric specification belong to, could be Capacity. - Category *string `json:"category,omitempty"` - // ResourceIDDimensionNameOverride - Account Resource Id. - ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` -} - -// OperationDetail operation detail payload -type OperationDetail struct { - // Name - Name of the operation - Name *string `json:"name,omitempty"` - // IsDataAction - Indicates whether the operation is a data action - IsDataAction *bool `json:"isDataAction,omitempty"` - // Display - Display of the operation - Display *OperationDisplay `json:"display,omitempty"` - // Origin - Origin of the operation - Origin *string `json:"origin,omitempty"` - // OperationProperties - Properties of the operation - *OperationProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationDetail. -func (od OperationDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if od.Name != nil { - objectMap["name"] = od.Name - } - if od.IsDataAction != nil { - objectMap["isDataAction"] = od.IsDataAction - } - if od.Display != nil { - objectMap["display"] = od.Display - } - if od.Origin != nil { - objectMap["origin"] = od.Origin - } - if od.OperationProperties != nil { - objectMap["properties"] = od.OperationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for OperationDetail struct. -func (od *OperationDetail) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - od.Name = &name - } - case "isDataAction": - if v != nil { - var isDataAction bool - err = json.Unmarshal(*v, &isDataAction) - if err != nil { - return err - } - od.IsDataAction = &isDataAction - } - case "display": - if v != nil { - var display OperationDisplay - err = json.Unmarshal(*v, &display) - if err != nil { - return err - } - od.Display = &display - } - case "origin": - if v != nil { - var origin string - err = json.Unmarshal(*v, &origin) - if err != nil { - return err - } - od.Origin = &origin - } - case "properties": - if v != nil { - var operationProperties OperationProperties - err = json.Unmarshal(*v, &operationProperties) - if err != nil { - return err - } - od.OperationProperties = &operationProperties - } - } - } - - return nil -} - -// OperationDisplay operation display payload -type OperationDisplay struct { - // Provider - Resource provider of the operation - Provider *string `json:"provider,omitempty"` - // Resource - Resource of the operation - Resource *string `json:"resource,omitempty"` - // Operation - Localized friendly name for the operation - Operation *string `json:"operation,omitempty"` - // Description - Localized friendly description for the operation - Description *string `json:"description,omitempty"` -} - -// OperationProperties properties of operation, include metric specifications. -type OperationProperties struct { - // ServiceSpecification - One property of operation, include metric specifications. - ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` -} - -// Operations the set of operations available for Maps. -type Operations struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; An operation available for Maps. - Value *[]OperationDetail `json:"value,omitempty"` - // NextLink - URL client should use to fetch the next page (per server side paging). - // It's null for now, added for future use. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for Operations. -func (o Operations) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if o.NextLink != nil { - objectMap["nextLink"] = o.NextLink - } - return json.Marshal(objectMap) -} - -// OperationsIterator provides access to a complete listing of OperationDetail values. -type OperationsIterator struct { - i int - page OperationsPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *OperationsIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *OperationsIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter OperationsIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter OperationsIterator) Response() Operations { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter OperationsIterator) Value() OperationDetail { - if !iter.page.NotDone() { - return OperationDetail{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the OperationsIterator type. -func NewOperationsIterator(page OperationsPage) OperationsIterator { - return OperationsIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (o Operations) IsEmpty() bool { - return o.Value == nil || len(*o.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (o Operations) hasNextLink() bool { - return o.NextLink != nil && len(*o.NextLink) != 0 -} - -// operationsPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (o Operations) operationsPreparer(ctx context.Context) (*http.Request, error) { - if !o.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(o.NextLink))) -} - -// OperationsPage contains a page of OperationDetail values. -type OperationsPage struct { - fn func(context.Context, Operations) (Operations, error) - o Operations -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *OperationsPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.o) - if err != nil { - return err - } - page.o = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *OperationsPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OperationsPage) NotDone() bool { - return !page.o.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page OperationsPage) Response() Operations { - return page.o -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page OperationsPage) Values() []OperationDetail { - if page.o.IsEmpty() { - return nil - } - return *page.o.Value -} - -// Creates a new instance of the OperationsPage type. -func NewOperationsPage(cur Operations, getNextPage func(context.Context, Operations) (Operations, error)) OperationsPage { - return OperationsPage{ - fn: getNextPage, - o: cur, - } -} - -// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not -// have tags and a location -type ProxyResource struct { - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProxyResource. -func (pr ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// Resource common fields that are returned in the response for all Azure Resource Manager resources -type Resource struct { - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ServiceSpecification one property of operation, include metric specifications. -type ServiceSpecification struct { - // MetricSpecifications - Metric specifications of operation. - MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` -} - -// Sku the SKU of the Maps Account. -type Sku struct { - // Name - The name of the SKU, in standard format (such as S0). Possible values include: 'NameS0', 'NameS1', 'NameG2' - Name Name `json:"name,omitempty"` - // Tier - READ-ONLY; Gets the sku tier. This is based on the SKU name. - Tier *string `json:"tier,omitempty"` -} - -// MarshalJSON is the custom marshaler for Sku. -func (s Sku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.Name != "" { - objectMap["name"] = s.Name - } - return json.Marshal(objectMap) -} - -// SystemData metadata pertaining to creation and last modification of the resource. -type SystemData struct { - // CreatedBy - The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` - // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' - CreatedByType CreatedByType `json:"createdByType,omitempty"` - // CreatedAt - The timestamp of resource creation (UTC). - CreatedAt *date.Time `json:"createdAt,omitempty"` - // LastModifiedBy - The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' - LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` - // LastModifiedAt - The timestamp of resource last modification (UTC) - LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` -} - -// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource -// which has 'tags' and a 'location' -type TrackedResource struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for TrackedResource. -func (tr TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tr.Tags != nil { - objectMap["tags"] = tr.Tags - } - if tr.Location != nil { - objectMap["location"] = tr.Location - } - return json.Marshal(objectMap) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/version.go deleted file mode 100644 index 50d028e3f1e3..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package maps - -import "github.com/Azure/azure-sdk-for-go/version" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// UserAgent returns the UserAgent string to use when sending http.Requests. -func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " maps/2021-02-01" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/README.md new file mode 100644 index 000000000000..89812eef627b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/README.md @@ -0,0 +1,160 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts` Documentation + +The `accounts` SDK allows for interaction with the Azure Resource Manager Service `maps` (API Version `2021-02-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/maps/2021-02-01/accounts" +``` + + +### Client Initialization + +```go +client := accounts.NewAccountsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +if err != nil { + // handle the error +} +``` + + +### Example Usage: `AccountsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := accounts.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +payload := accounts.MapsAccount{ + // ... +} + +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: `AccountsClient.Delete` + +```go +ctx := context.TODO() +id := accounts.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") +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: `AccountsClient.Get` + +```go +ctx := context.TODO() +id := accounts.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") +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: `AccountsClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := accounts.NewResourceGroupID() +// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `AccountsClient.ListBySubscription` + +```go +ctx := context.TODO() +id := accounts.NewSubscriptionID() +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `AccountsClient.ListKeys` + +```go +ctx := context.TODO() +id := accounts.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") +read, err := client.ListKeys(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AccountsClient.RegenerateKeys` + +```go +ctx := context.TODO() +id := accounts.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +payload := accounts.MapsKeySpecification{ + // ... +} + +read, err := client.RegenerateKeys(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AccountsClient.Update` + +```go +ctx := context.TODO() +id := accounts.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +payload := accounts.MapsAccountUpdateParameters{ + // ... +} + +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/internal/services/maps/sdk/2021-02-01/accounts/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/client.go similarity index 66% rename from internal/services/maps/sdk/2021-02-01/accounts/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/client.go index b53630d7e0e0..edcf2d80f353 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/client.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/client.go @@ -2,6 +2,9 @@ package accounts import "github.com/Azure/go-autorest/autorest" +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + type AccountsClient struct { Client autorest.Client baseUri string diff --git a/internal/services/maps/sdk/2021-02-01/accounts/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/constants.go similarity index 63% rename from internal/services/maps/sdk/2021-02-01/accounts/constants.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/constants.go index 8a78feb2a4ad..1a147bcb0ceb 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/constants.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/constants.go @@ -2,39 +2,8 @@ package accounts import "strings" -type CreatedByType string - -const ( - CreatedByTypeApplication CreatedByType = "Application" - CreatedByTypeKey CreatedByType = "Key" - CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - CreatedByTypeUser CreatedByType = "User" -) - -func PossibleValuesForCreatedByType() []string { - return []string{ - string(CreatedByTypeApplication), - string(CreatedByTypeKey), - string(CreatedByTypeManagedIdentity), - string(CreatedByTypeUser), - } -} - -func parseCreatedByType(input string) (*CreatedByType, error) { - vals := map[string]CreatedByType{ - "application": CreatedByTypeApplication, - "key": CreatedByTypeKey, - "managedidentity": CreatedByTypeManagedIdentity, - "user": CreatedByTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CreatedByType(input) - return &out, nil -} +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyType string diff --git a/internal/services/maps/sdk/2021-02-01/accounts/id_account.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/id_account.go similarity index 90% rename from internal/services/maps/sdk/2021-02-01/accounts/id_account.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/id_account.go index dcee34c86f3b..c536f82e2f34 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/id_account.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/id_account.go @@ -102,13 +102,13 @@ func (id AccountId) ID() string { // Segments returns a slice of Resource ID Segments which comprise this Account ID func (id AccountId) Segments() []resourceids.Segment { return []resourceids.Segment{ - resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("providers", "providers", "providers"), - resourceids.ResourceProviderSegment("microsoftMaps", "Microsoft.Maps", "Microsoft.Maps"), - resourceids.StaticSegment("accounts", "accounts", "accounts"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftMaps", "Microsoft.Maps", "Microsoft.Maps"), + resourceids.StaticSegment("staticAccounts", "accounts", "accounts"), resourceids.UserSpecifiedSegment("accountName", "accountValue"), } } diff --git a/internal/services/maps/sdk/2021-02-01/accounts/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_createorupdate_autorest.go similarity index 85% rename from internal/services/maps/sdk/2021-02-01/accounts/method_createorupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_createorupdate_autorest.go index 852c63e2e2f3..dc5b7f9fdddd 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/method_createorupdate_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_createorupdate_autorest.go @@ -8,13 +8,16 @@ import ( "github.com/Azure/go-autorest/autorest/azure" ) -type CreateOrUpdateResponse struct { +// 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 Model *MapsAccount } // CreateOrUpdate ... -func (c AccountsClient) CreateOrUpdate(ctx context.Context, id AccountId, input MapsAccount) (result CreateOrUpdateResponse, err error) { +func (c AccountsClient) CreateOrUpdate(ctx context.Context, id AccountId, input MapsAccount) (result CreateOrUpdateOperationResponse, err error) { req, err := c.preparerForCreateOrUpdate(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "accounts.AccountsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -54,7 +57,7 @@ func (c AccountsClient) preparerForCreateOrUpdate(ctx context.Context, id Accoun // responderForCreateOrUpdate handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (c AccountsClient) responderForCreateOrUpdate(resp *http.Response) (result CreateOrUpdateResponse, err error) { +func (c AccountsClient) responderForCreateOrUpdate(resp *http.Response) (result CreateOrUpdateOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), diff --git a/internal/services/maps/sdk/2021-02-01/accounts/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_delete_autorest.go similarity index 83% rename from internal/services/maps/sdk/2021-02-01/accounts/method_delete_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_delete_autorest.go index 8fa3c4516102..e6570ddcd010 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/method_delete_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_delete_autorest.go @@ -8,12 +8,15 @@ import ( "github.com/Azure/go-autorest/autorest/azure" ) -type DeleteResponse struct { +// 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 } // Delete ... -func (c AccountsClient) Delete(ctx context.Context, id AccountId) (result DeleteResponse, err error) { +func (c AccountsClient) Delete(ctx context.Context, id AccountId) (result DeleteOperationResponse, err error) { req, err := c.preparerForDelete(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "accounts.AccountsClient", "Delete", nil, "Failure preparing request") @@ -42,6 +45,7 @@ func (c AccountsClient) preparerForDelete(ctx context.Context, id AccountId) (*h } preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsDelete(), autorest.WithBaseURL(c.baseUri), autorest.WithPath(id.ID()), @@ -51,7 +55,7 @@ func (c AccountsClient) preparerForDelete(ctx context.Context, id AccountId) (*h // responderForDelete handles the response to the Delete request. The method always // closes the http.Response Body. -func (c AccountsClient) responderForDelete(resp *http.Response) (result DeleteResponse, err error) { +func (c AccountsClient) responderForDelete(resp *http.Response) (result DeleteOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), diff --git a/internal/services/maps/sdk/2021-02-01/accounts/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_get_autorest.go similarity index 86% rename from internal/services/maps/sdk/2021-02-01/accounts/method_get_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_get_autorest.go index e20dcf88a31c..7ce4384d6624 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/method_get_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_get_autorest.go @@ -8,13 +8,16 @@ import ( "github.com/Azure/go-autorest/autorest/azure" ) -type GetResponse struct { +// 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 Model *MapsAccount } // Get ... -func (c AccountsClient) Get(ctx context.Context, id AccountId) (result GetResponse, err error) { +func (c AccountsClient) Get(ctx context.Context, id AccountId) (result GetOperationResponse, err error) { req, err := c.preparerForGet(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "accounts.AccountsClient", "Get", nil, "Failure preparing request") @@ -53,7 +56,7 @@ func (c AccountsClient) preparerForGet(ctx context.Context, id AccountId) (*http // responderForGet handles the response to the Get request. The method always // closes the http.Response Body. -func (c AccountsClient) responderForGet(resp *http.Response) (result GetResponse, err error) { +func (c AccountsClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/internal/services/maps/sdk/2021-02-01/accounts/method_listbyresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_listbyresourcegroup_autorest.go similarity index 83% rename from internal/services/maps/sdk/2021-02-01/accounts/method_listbyresourcegroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_listbyresourcegroup_autorest.go index 36e46653e045..5f5ac92d683a 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/method_listbyresourcegroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_listbyresourcegroup_autorest.go @@ -8,25 +8,29 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) -type ListByResourceGroupResponse struct { +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByResourceGroupOperationResponse struct { HttpResponse *http.Response Model *[]MapsAccount nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListByResourceGroupResponse, error) + nextPageFunc func(ctx context.Context, nextLink string) (ListByResourceGroupOperationResponse, error) } type ListByResourceGroupCompleteResult struct { Items []MapsAccount } -func (r ListByResourceGroupResponse) HasMore() bool { +func (r ListByResourceGroupOperationResponse) HasMore() bool { return r.nextLink != nil } -func (r ListByResourceGroupResponse) LoadMore(ctx context.Context) (resp ListByResourceGroupResponse, err error) { +func (r ListByResourceGroupOperationResponse) LoadMore(ctx context.Context) (resp ListByResourceGroupOperationResponse, err error) { if !r.HasMore() { err = fmt.Errorf("no more pages returned") return @@ -35,7 +39,7 @@ func (r ListByResourceGroupResponse) LoadMore(ctx context.Context) (resp ListByR } // ListByResourceGroup ... -func (c AccountsClient) ListByResourceGroup(ctx context.Context, id ResourceGroupId) (resp ListByResourceGroupResponse, err error) { +func (c AccountsClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (resp ListByResourceGroupOperationResponse, err error) { req, err := c.preparerForListByResourceGroup(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "accounts.AccountsClient", "ListByResourceGroup", nil, "Failure preparing request") @@ -57,12 +61,12 @@ func (c AccountsClient) ListByResourceGroup(ctx context.Context, id ResourceGrou } // ListByResourceGroupComplete retrieves all of the results into a single object -func (c AccountsClient) ListByResourceGroupComplete(ctx context.Context, id ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, MapsAccountPredicate{}) +func (c AccountsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, MapsAccountOperationPredicate{}) } // ListByResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c AccountsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id ResourceGroupId, predicate MapsAccountPredicate) (resp ListByResourceGroupCompleteResult, err error) { +func (c AccountsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate MapsAccountOperationPredicate) (resp ListByResourceGroupCompleteResult, err error) { items := make([]MapsAccount, 0) page, err := c.ListByResourceGroup(ctx, id) @@ -101,7 +105,7 @@ func (c AccountsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context } // preparerForListByResourceGroup prepares the ListByResourceGroup request. -func (c AccountsClient) preparerForListByResourceGroup(ctx context.Context, id ResourceGroupId) (*http.Request, error) { +func (c AccountsClient) preparerForListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -142,7 +146,7 @@ func (c AccountsClient) preparerForListByResourceGroupWithNextLink(ctx context.C // responderForListByResourceGroup handles the response to the ListByResourceGroup request. The method always // closes the http.Response Body. -func (c AccountsClient) responderForListByResourceGroup(resp *http.Response) (result ListByResourceGroupResponse, err error) { +func (c AccountsClient) responderForListByResourceGroup(resp *http.Response) (result ListByResourceGroupOperationResponse, err error) { type page struct { Values []MapsAccount `json:"value"` NextLink *string `json:"nextLink"` @@ -157,7 +161,7 @@ func (c AccountsClient) responderForListByResourceGroup(resp *http.Response) (re result.Model = &respObj.Values result.nextLink = respObj.NextLink if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByResourceGroupResponse, err error) { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByResourceGroupOperationResponse, err error) { req, err := c.preparerForListByResourceGroupWithNextLink(ctx, nextLink) if err != nil { err = autorest.NewErrorWithError(err, "accounts.AccountsClient", "ListByResourceGroup", nil, "Failure preparing request") diff --git a/internal/services/maps/sdk/2021-02-01/accounts/method_listbysubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_listbysubscription_autorest.go similarity index 83% rename from internal/services/maps/sdk/2021-02-01/accounts/method_listbysubscription_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_listbysubscription_autorest.go index d110c7d8dabb..789ad076477d 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/method_listbysubscription_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_listbysubscription_autorest.go @@ -8,25 +8,29 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" ) -type ListBySubscriptionResponse struct { +// 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 Model *[]MapsAccount nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListBySubscriptionResponse, error) + nextPageFunc func(ctx context.Context, nextLink string) (ListBySubscriptionOperationResponse, error) } type ListBySubscriptionCompleteResult struct { Items []MapsAccount } -func (r ListBySubscriptionResponse) HasMore() bool { +func (r ListBySubscriptionOperationResponse) HasMore() bool { return r.nextLink != nil } -func (r ListBySubscriptionResponse) LoadMore(ctx context.Context) (resp ListBySubscriptionResponse, err error) { +func (r ListBySubscriptionOperationResponse) LoadMore(ctx context.Context) (resp ListBySubscriptionOperationResponse, err error) { if !r.HasMore() { err = fmt.Errorf("no more pages returned") return @@ -35,7 +39,7 @@ func (r ListBySubscriptionResponse) LoadMore(ctx context.Context) (resp ListBySu } // ListBySubscription ... -func (c AccountsClient) ListBySubscription(ctx context.Context, id SubscriptionId) (resp ListBySubscriptionResponse, err error) { +func (c AccountsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (resp ListBySubscriptionOperationResponse, err error) { req, err := c.preparerForListBySubscription(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "accounts.AccountsClient", "ListBySubscription", nil, "Failure preparing request") @@ -57,12 +61,12 @@ func (c AccountsClient) ListBySubscription(ctx context.Context, id SubscriptionI } // ListBySubscriptionComplete retrieves all of the results into a single object -func (c AccountsClient) ListBySubscriptionComplete(ctx context.Context, id SubscriptionId) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, MapsAccountPredicate{}) +func (c AccountsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, MapsAccountOperationPredicate{}) } // ListBySubscriptionCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c AccountsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id SubscriptionId, predicate MapsAccountPredicate) (resp ListBySubscriptionCompleteResult, err error) { +func (c AccountsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate MapsAccountOperationPredicate) (resp ListBySubscriptionCompleteResult, err error) { items := make([]MapsAccount, 0) page, err := c.ListBySubscription(ctx, id) @@ -101,7 +105,7 @@ func (c AccountsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context. } // preparerForListBySubscription prepares the ListBySubscription request. -func (c AccountsClient) preparerForListBySubscription(ctx context.Context, id SubscriptionId) (*http.Request, error) { +func (c AccountsClient) preparerForListBySubscription(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -142,7 +146,7 @@ func (c AccountsClient) preparerForListBySubscriptionWithNextLink(ctx context.Co // responderForListBySubscription handles the response to the ListBySubscription request. The method always // closes the http.Response Body. -func (c AccountsClient) responderForListBySubscription(resp *http.Response) (result ListBySubscriptionResponse, err error) { +func (c AccountsClient) responderForListBySubscription(resp *http.Response) (result ListBySubscriptionOperationResponse, err error) { type page struct { Values []MapsAccount `json:"value"` NextLink *string `json:"nextLink"` @@ -157,7 +161,7 @@ func (c AccountsClient) responderForListBySubscription(resp *http.Response) (res result.Model = &respObj.Values result.nextLink = respObj.NextLink if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListBySubscriptionResponse, err error) { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListBySubscriptionOperationResponse, err error) { req, err := c.preparerForListBySubscriptionWithNextLink(ctx, nextLink) if err != nil { err = autorest.NewErrorWithError(err, "accounts.AccountsClient", "ListBySubscription", nil, "Failure preparing request") diff --git a/internal/services/maps/sdk/2021-02-01/accounts/method_listkeys_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_listkeys_autorest.go similarity index 86% rename from internal/services/maps/sdk/2021-02-01/accounts/method_listkeys_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_listkeys_autorest.go index 42790f66bb0f..8283cc918522 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/method_listkeys_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_listkeys_autorest.go @@ -9,13 +9,16 @@ import ( "github.com/Azure/go-autorest/autorest/azure" ) -type ListKeysResponse struct { +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListKeysOperationResponse struct { HttpResponse *http.Response Model *MapsAccountKeys } // ListKeys ... -func (c AccountsClient) ListKeys(ctx context.Context, id AccountId) (result ListKeysResponse, err error) { +func (c AccountsClient) ListKeys(ctx context.Context, id AccountId) (result ListKeysOperationResponse, err error) { req, err := c.preparerForListKeys(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "accounts.AccountsClient", "ListKeys", nil, "Failure preparing request") @@ -54,7 +57,7 @@ func (c AccountsClient) preparerForListKeys(ctx context.Context, id AccountId) ( // responderForListKeys handles the response to the ListKeys request. The method always // closes the http.Response Body. -func (c AccountsClient) responderForListKeys(resp *http.Response) (result ListKeysResponse, err error) { +func (c AccountsClient) responderForListKeys(resp *http.Response) (result ListKeysOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/internal/services/maps/sdk/2021-02-01/accounts/method_regeneratekeys_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_regeneratekeys_autorest.go similarity index 85% rename from internal/services/maps/sdk/2021-02-01/accounts/method_regeneratekeys_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_regeneratekeys_autorest.go index 6cbd78060c81..276196bada89 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/method_regeneratekeys_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_regeneratekeys_autorest.go @@ -9,13 +9,16 @@ import ( "github.com/Azure/go-autorest/autorest/azure" ) -type RegenerateKeysResponse struct { +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegenerateKeysOperationResponse struct { HttpResponse *http.Response Model *MapsAccountKeys } // RegenerateKeys ... -func (c AccountsClient) RegenerateKeys(ctx context.Context, id AccountId, input MapsKeySpecification) (result RegenerateKeysResponse, err error) { +func (c AccountsClient) RegenerateKeys(ctx context.Context, id AccountId, input MapsKeySpecification) (result RegenerateKeysOperationResponse, err error) { req, err := c.preparerForRegenerateKeys(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "accounts.AccountsClient", "RegenerateKeys", nil, "Failure preparing request") @@ -55,7 +58,7 @@ func (c AccountsClient) preparerForRegenerateKeys(ctx context.Context, id Accoun // responderForRegenerateKeys handles the response to the RegenerateKeys request. The method always // closes the http.Response Body. -func (c AccountsClient) responderForRegenerateKeys(resp *http.Response) (result RegenerateKeysResponse, err error) { +func (c AccountsClient) responderForRegenerateKeys(resp *http.Response) (result RegenerateKeysOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/internal/services/maps/sdk/2021-02-01/accounts/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_update_autorest.go similarity index 85% rename from internal/services/maps/sdk/2021-02-01/accounts/method_update_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_update_autorest.go index d70440f1518f..252b8abce3b0 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/method_update_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/method_update_autorest.go @@ -8,13 +8,16 @@ import ( "github.com/Azure/go-autorest/autorest/azure" ) -type UpdateResponse struct { +// 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 Model *MapsAccount } // Update ... -func (c AccountsClient) Update(ctx context.Context, id AccountId, input MapsAccountUpdateParameters) (result UpdateResponse, err error) { +func (c AccountsClient) Update(ctx context.Context, id AccountId, input MapsAccountUpdateParameters) (result UpdateOperationResponse, err error) { req, err := c.preparerForUpdate(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "accounts.AccountsClient", "Update", nil, "Failure preparing request") @@ -54,7 +57,7 @@ func (c AccountsClient) preparerForUpdate(ctx context.Context, id AccountId, inp // responderForUpdate handles the response to the Update request. The method always // closes the http.Response Body. -func (c AccountsClient) responderForUpdate(resp *http.Response) (result UpdateResponse, err error) { +func (c AccountsClient) responderForUpdate(resp *http.Response) (result UpdateOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/internal/services/maps/sdk/2021-02-01/accounts/model_mapsaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapsaccount.go similarity index 62% rename from internal/services/maps/sdk/2021-02-01/accounts/model_mapsaccount.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapsaccount.go index d82e68c6a836..13f950fb477d 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/model_mapsaccount.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapsaccount.go @@ -1,5 +1,12 @@ package accounts +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 MapsAccount struct { Id *string `json:"id,omitempty"` Kind *Kind `json:"kind,omitempty"` @@ -7,7 +14,7 @@ type MapsAccount struct { Name *string `json:"name,omitempty"` Properties *MapsAccountProperties `json:"properties,omitempty"` Sku Sku `json:"sku"` - SystemData *SystemData `json:"systemData,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` Tags *map[string]string `json:"tags,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/internal/services/maps/sdk/2021-02-01/accounts/model_mapsaccountkeys.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapsaccountkeys.go similarity index 67% rename from internal/services/maps/sdk/2021-02-01/accounts/model_mapsaccountkeys.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapsaccountkeys.go index 1bd4f1667578..2e45e9215118 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/model_mapsaccountkeys.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapsaccountkeys.go @@ -1,5 +1,8 @@ package accounts +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + type MapsAccountKeys struct { PrimaryKey *string `json:"primaryKey,omitempty"` PrimaryKeyLastUpdated *string `json:"primaryKeyLastUpdated,omitempty"` diff --git a/internal/services/maps/sdk/2021-02-01/accounts/model_mapsaccountproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapsaccountproperties.go similarity index 60% rename from internal/services/maps/sdk/2021-02-01/accounts/model_mapsaccountproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapsaccountproperties.go index 12703dd2ef55..fd4131437ba8 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/model_mapsaccountproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapsaccountproperties.go @@ -1,5 +1,8 @@ package accounts +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + type MapsAccountProperties struct { DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` diff --git a/internal/services/maps/sdk/2021-02-01/accounts/model_mapsaccountupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapsaccountupdateparameters.go similarity index 65% rename from internal/services/maps/sdk/2021-02-01/accounts/model_mapsaccountupdateparameters.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapsaccountupdateparameters.go index 26d831f445fe..e07f3265e37f 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/model_mapsaccountupdateparameters.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapsaccountupdateparameters.go @@ -1,5 +1,8 @@ package accounts +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + type MapsAccountUpdateParameters struct { Kind *Kind `json:"kind,omitempty"` Properties *MapsAccountProperties `json:"properties,omitempty"` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapskeyspecification.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapskeyspecification.go new file mode 100644 index 000000000000..dacf7b5d9dc2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_mapskeyspecification.go @@ -0,0 +1,8 @@ +package accounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MapsKeySpecification struct { + KeyType KeyType `json:"keyType"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_sku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_sku.go new file mode 100644 index 000000000000..004ced791b03 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/model_sku.go @@ -0,0 +1,9 @@ +package accounts + +// 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 { + Name Name `json:"name"` + Tier *string `json:"tier,omitempty"` +} diff --git a/internal/services/maps/sdk/2021-02-01/accounts/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/predicates.go similarity index 79% rename from internal/services/maps/sdk/2021-02-01/accounts/predicates.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/predicates.go index 05de8044727f..18746e427d7f 100644 --- a/internal/services/maps/sdk/2021-02-01/accounts/predicates.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/predicates.go @@ -1,13 +1,13 @@ package accounts -type MapsAccountPredicate struct { +type MapsAccountOperationPredicate struct { Id *string Location *string Name *string Type *string } -func (p MapsAccountPredicate) Matches(input MapsAccount) bool { +func (p MapsAccountOperationPredicate) Matches(input MapsAccount) bool { if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { return false diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/version.go new file mode 100644 index 000000000000..730444235e07 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts/version.go @@ -0,0 +1,12 @@ +package accounts + +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 = "2021-02-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/accounts/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/README.md new file mode 100644 index 000000000000..7b429b683fc3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/README.md @@ -0,0 +1,109 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators` Documentation + +The `creators` SDK allows for interaction with the Azure Resource Manager Service `maps` (API Version `2021-02-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/maps/2021-02-01/creators" +``` + + +### Client Initialization + +```go +client := creators.NewCreatorsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +if err != nil { + // handle the error +} +``` + + +### Example Usage: `CreatorsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := creators.NewCreatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "creatorValue") + +payload := creators.Creator{ + // ... +} + +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: `CreatorsClient.Delete` + +```go +ctx := context.TODO() +id := creators.NewCreatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "creatorValue") +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: `CreatorsClient.Get` + +```go +ctx := context.TODO() +id := creators.NewCreatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "creatorValue") +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: `CreatorsClient.ListByAccount` + +```go +ctx := context.TODO() +id := creators.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") +// alternatively `client.ListByAccount(ctx, id)` can be used to do batched pagination +items, err := client.ListByAccountComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `CreatorsClient.Update` + +```go +ctx := context.TODO() +id := creators.NewCreatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "creatorValue") + +payload := creators.CreatorUpdateParameters{ + // ... +} + +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/internal/services/maps/sdk/2021-02-01/creators/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/client.go similarity index 66% rename from internal/services/maps/sdk/2021-02-01/creators/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/client.go index f01bc96dccfb..ce49fe39ee4c 100644 --- a/internal/services/maps/sdk/2021-02-01/creators/client.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/client.go @@ -2,6 +2,9 @@ package creators import "github.com/Azure/go-autorest/autorest" +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + type CreatorsClient struct { Client autorest.Client baseUri string diff --git a/internal/services/maps/sdk/2021-02-01/creators/id_account.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/id_account.go similarity index 90% rename from internal/services/maps/sdk/2021-02-01/creators/id_account.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/id_account.go index eaf98848f564..ca85d5406fcb 100644 --- a/internal/services/maps/sdk/2021-02-01/creators/id_account.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/id_account.go @@ -102,13 +102,13 @@ func (id AccountId) ID() string { // Segments returns a slice of Resource ID Segments which comprise this Account ID func (id AccountId) Segments() []resourceids.Segment { return []resourceids.Segment{ - resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("providers", "providers", "providers"), - resourceids.ResourceProviderSegment("microsoftMaps", "Microsoft.Maps", "Microsoft.Maps"), - resourceids.StaticSegment("accounts", "accounts", "accounts"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftMaps", "Microsoft.Maps", "Microsoft.Maps"), + resourceids.StaticSegment("staticAccounts", "accounts", "accounts"), resourceids.UserSpecifiedSegment("accountName", "accountValue"), } } diff --git a/internal/services/maps/sdk/2021-02-01/creators/id_creator.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/id_creator.go similarity index 90% rename from internal/services/maps/sdk/2021-02-01/creators/id_creator.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/id_creator.go index dda2e7a230f1..5adf12e95d37 100644 --- a/internal/services/maps/sdk/2021-02-01/creators/id_creator.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/id_creator.go @@ -112,15 +112,15 @@ func (id CreatorId) ID() string { // Segments returns a slice of Resource ID Segments which comprise this Creator ID func (id CreatorId) Segments() []resourceids.Segment { return []resourceids.Segment{ - resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("providers", "providers", "providers"), - resourceids.ResourceProviderSegment("microsoftMaps", "Microsoft.Maps", "Microsoft.Maps"), - resourceids.StaticSegment("accounts", "accounts", "accounts"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftMaps", "Microsoft.Maps", "Microsoft.Maps"), + resourceids.StaticSegment("staticAccounts", "accounts", "accounts"), resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("creators", "creators", "creators"), + resourceids.StaticSegment("staticCreators", "creators", "creators"), resourceids.UserSpecifiedSegment("creatorName", "creatorValue"), } } diff --git a/internal/services/maps/sdk/2021-02-01/creators/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_createorupdate_autorest.go similarity index 85% rename from internal/services/maps/sdk/2021-02-01/creators/method_createorupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_createorupdate_autorest.go index acd0ca7ba9b2..4351dbfa6bb9 100644 --- a/internal/services/maps/sdk/2021-02-01/creators/method_createorupdate_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_createorupdate_autorest.go @@ -8,13 +8,16 @@ import ( "github.com/Azure/go-autorest/autorest/azure" ) -type CreateOrUpdateResponse struct { +// 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 Model *Creator } // CreateOrUpdate ... -func (c CreatorsClient) CreateOrUpdate(ctx context.Context, id CreatorId, input Creator) (result CreateOrUpdateResponse, err error) { +func (c CreatorsClient) CreateOrUpdate(ctx context.Context, id CreatorId, input Creator) (result CreateOrUpdateOperationResponse, err error) { req, err := c.preparerForCreateOrUpdate(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "creators.CreatorsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -54,7 +57,7 @@ func (c CreatorsClient) preparerForCreateOrUpdate(ctx context.Context, id Creato // responderForCreateOrUpdate handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (c CreatorsClient) responderForCreateOrUpdate(resp *http.Response) (result CreateOrUpdateResponse, err error) { +func (c CreatorsClient) responderForCreateOrUpdate(resp *http.Response) (result CreateOrUpdateOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), diff --git a/internal/services/maps/sdk/2021-02-01/creators/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_delete_autorest.go similarity index 83% rename from internal/services/maps/sdk/2021-02-01/creators/method_delete_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_delete_autorest.go index 808983262e61..7ebf141c0529 100644 --- a/internal/services/maps/sdk/2021-02-01/creators/method_delete_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_delete_autorest.go @@ -8,12 +8,15 @@ import ( "github.com/Azure/go-autorest/autorest/azure" ) -type DeleteResponse struct { +// 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 } // Delete ... -func (c CreatorsClient) Delete(ctx context.Context, id CreatorId) (result DeleteResponse, err error) { +func (c CreatorsClient) Delete(ctx context.Context, id CreatorId) (result DeleteOperationResponse, err error) { req, err := c.preparerForDelete(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "creators.CreatorsClient", "Delete", nil, "Failure preparing request") @@ -42,6 +45,7 @@ func (c CreatorsClient) preparerForDelete(ctx context.Context, id CreatorId) (*h } preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsDelete(), autorest.WithBaseURL(c.baseUri), autorest.WithPath(id.ID()), @@ -51,7 +55,7 @@ func (c CreatorsClient) preparerForDelete(ctx context.Context, id CreatorId) (*h // responderForDelete handles the response to the Delete request. The method always // closes the http.Response Body. -func (c CreatorsClient) responderForDelete(resp *http.Response) (result DeleteResponse, err error) { +func (c CreatorsClient) responderForDelete(resp *http.Response) (result DeleteOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), diff --git a/internal/services/maps/sdk/2021-02-01/creators/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_get_autorest.go similarity index 86% rename from internal/services/maps/sdk/2021-02-01/creators/method_get_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_get_autorest.go index cf25918e10f9..76b9ff3583c1 100644 --- a/internal/services/maps/sdk/2021-02-01/creators/method_get_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_get_autorest.go @@ -8,13 +8,16 @@ import ( "github.com/Azure/go-autorest/autorest/azure" ) -type GetResponse struct { +// 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 Model *Creator } // Get ... -func (c CreatorsClient) Get(ctx context.Context, id CreatorId) (result GetResponse, err error) { +func (c CreatorsClient) Get(ctx context.Context, id CreatorId) (result GetOperationResponse, err error) { req, err := c.preparerForGet(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "creators.CreatorsClient", "Get", nil, "Failure preparing request") @@ -53,7 +56,7 @@ func (c CreatorsClient) preparerForGet(ctx context.Context, id CreatorId) (*http // responderForGet handles the response to the Get request. The method always // closes the http.Response Body. -func (c CreatorsClient) responderForGet(resp *http.Response) (result GetResponse, err error) { +func (c CreatorsClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/internal/services/maps/sdk/2021-02-01/creators/method_listbyaccount_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_listbyaccount_autorest.go similarity index 87% rename from internal/services/maps/sdk/2021-02-01/creators/method_listbyaccount_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_listbyaccount_autorest.go index 0cf1e097cafa..c084a1699d52 100644 --- a/internal/services/maps/sdk/2021-02-01/creators/method_listbyaccount_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_listbyaccount_autorest.go @@ -10,23 +10,26 @@ import ( "github.com/Azure/go-autorest/autorest/azure" ) -type ListByAccountResponse struct { +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByAccountOperationResponse struct { HttpResponse *http.Response Model *[]Creator nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListByAccountResponse, error) + nextPageFunc func(ctx context.Context, nextLink string) (ListByAccountOperationResponse, error) } type ListByAccountCompleteResult struct { Items []Creator } -func (r ListByAccountResponse) HasMore() bool { +func (r ListByAccountOperationResponse) HasMore() bool { return r.nextLink != nil } -func (r ListByAccountResponse) LoadMore(ctx context.Context) (resp ListByAccountResponse, err error) { +func (r ListByAccountOperationResponse) LoadMore(ctx context.Context) (resp ListByAccountOperationResponse, err error) { if !r.HasMore() { err = fmt.Errorf("no more pages returned") return @@ -35,7 +38,7 @@ func (r ListByAccountResponse) LoadMore(ctx context.Context) (resp ListByAccount } // ListByAccount ... -func (c CreatorsClient) ListByAccount(ctx context.Context, id AccountId) (resp ListByAccountResponse, err error) { +func (c CreatorsClient) ListByAccount(ctx context.Context, id AccountId) (resp ListByAccountOperationResponse, err error) { req, err := c.preparerForListByAccount(ctx, id) if err != nil { err = autorest.NewErrorWithError(err, "creators.CreatorsClient", "ListByAccount", nil, "Failure preparing request") @@ -58,11 +61,11 @@ func (c CreatorsClient) ListByAccount(ctx context.Context, id AccountId) (resp L // ListByAccountComplete retrieves all of the results into a single object func (c CreatorsClient) ListByAccountComplete(ctx context.Context, id AccountId) (ListByAccountCompleteResult, error) { - return c.ListByAccountCompleteMatchingPredicate(ctx, id, CreatorPredicate{}) + return c.ListByAccountCompleteMatchingPredicate(ctx, id, CreatorOperationPredicate{}) } // ListByAccountCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c CreatorsClient) ListByAccountCompleteMatchingPredicate(ctx context.Context, id AccountId, predicate CreatorPredicate) (resp ListByAccountCompleteResult, err error) { +func (c CreatorsClient) ListByAccountCompleteMatchingPredicate(ctx context.Context, id AccountId, predicate CreatorOperationPredicate) (resp ListByAccountCompleteResult, err error) { items := make([]Creator, 0) page, err := c.ListByAccount(ctx, id) @@ -142,7 +145,7 @@ func (c CreatorsClient) preparerForListByAccountWithNextLink(ctx context.Context // responderForListByAccount handles the response to the ListByAccount request. The method always // closes the http.Response Body. -func (c CreatorsClient) responderForListByAccount(resp *http.Response) (result ListByAccountResponse, err error) { +func (c CreatorsClient) responderForListByAccount(resp *http.Response) (result ListByAccountOperationResponse, err error) { type page struct { Values []Creator `json:"value"` NextLink *string `json:"nextLink"` @@ -157,7 +160,7 @@ func (c CreatorsClient) responderForListByAccount(resp *http.Response) (result L result.Model = &respObj.Values result.nextLink = respObj.NextLink if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByAccountResponse, err error) { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByAccountOperationResponse, err error) { req, err := c.preparerForListByAccountWithNextLink(ctx, nextLink) if err != nil { err = autorest.NewErrorWithError(err, "creators.CreatorsClient", "ListByAccount", nil, "Failure preparing request") diff --git a/internal/services/maps/sdk/2021-02-01/creators/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_update_autorest.go similarity index 85% rename from internal/services/maps/sdk/2021-02-01/creators/method_update_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_update_autorest.go index 131d64d6ec47..6d3d1656c472 100644 --- a/internal/services/maps/sdk/2021-02-01/creators/method_update_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/method_update_autorest.go @@ -8,13 +8,16 @@ import ( "github.com/Azure/go-autorest/autorest/azure" ) -type UpdateResponse struct { +// 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 Model *Creator } // Update ... -func (c CreatorsClient) Update(ctx context.Context, id CreatorId, input CreatorUpdateParameters) (result UpdateResponse, err error) { +func (c CreatorsClient) Update(ctx context.Context, id CreatorId, input CreatorUpdateParameters) (result UpdateOperationResponse, err error) { req, err := c.preparerForUpdate(ctx, id, input) if err != nil { err = autorest.NewErrorWithError(err, "creators.CreatorsClient", "Update", nil, "Failure preparing request") @@ -54,7 +57,7 @@ func (c CreatorsClient) preparerForUpdate(ctx context.Context, id CreatorId, inp // responderForUpdate handles the response to the Update request. The method always // closes the http.Response Body. -func (c CreatorsClient) responderForUpdate(resp *http.Response) (result UpdateResponse, err error) { +func (c CreatorsClient) responderForUpdate(resp *http.Response) (result UpdateOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/internal/services/maps/sdk/2021-02-01/creators/model_creator.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/model_creator.go similarity index 69% rename from internal/services/maps/sdk/2021-02-01/creators/model_creator.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/model_creator.go index c21ffc6c4023..377f7c26074c 100644 --- a/internal/services/maps/sdk/2021-02-01/creators/model_creator.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/model_creator.go @@ -1,5 +1,8 @@ package creators +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + type Creator struct { Id *string `json:"id,omitempty"` Location string `json:"location"` diff --git a/internal/services/maps/sdk/2021-02-01/creators/model_creatorproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/model_creatorproperties.go similarity index 51% rename from internal/services/maps/sdk/2021-02-01/creators/model_creatorproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/model_creatorproperties.go index 29911060ce26..f6cf082a4526 100644 --- a/internal/services/maps/sdk/2021-02-01/creators/model_creatorproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/model_creatorproperties.go @@ -1,5 +1,8 @@ package creators +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + type CreatorProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` StorageUnits int64 `json:"storageUnits"` diff --git a/internal/services/maps/sdk/2021-02-01/creators/model_creatorupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/model_creatorupdateparameters.go similarity index 52% rename from internal/services/maps/sdk/2021-02-01/creators/model_creatorupdateparameters.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/model_creatorupdateparameters.go index 9642bcb0d329..a26242b4b28d 100644 --- a/internal/services/maps/sdk/2021-02-01/creators/model_creatorupdateparameters.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/model_creatorupdateparameters.go @@ -1,5 +1,8 @@ package creators +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + type CreatorUpdateParameters struct { Properties *CreatorProperties `json:"properties,omitempty"` Tags *map[string]string `json:"tags,omitempty"` diff --git a/internal/services/maps/sdk/2021-02-01/creators/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/predicates.go similarity index 80% rename from internal/services/maps/sdk/2021-02-01/creators/predicates.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/predicates.go index 5094dec93f85..5edfea669561 100644 --- a/internal/services/maps/sdk/2021-02-01/creators/predicates.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/predicates.go @@ -1,13 +1,13 @@ package creators -type CreatorPredicate struct { +type CreatorOperationPredicate struct { Id *string Location *string Name *string Type *string } -func (p CreatorPredicate) Matches(input Creator) bool { +func (p CreatorOperationPredicate) Matches(input Creator) bool { if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { return false diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/version.go new file mode 100644 index 000000000000..ed4d3606e125 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators/version.go @@ -0,0 +1,12 @@ +package creators + +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 = "2021-02-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/creators/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 7d9e912cb37b..2e291762d63b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -42,7 +42,6 @@ github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices github.com/Azure/azure-sdk-for-go/services/maintenance/mgmt/2021-05-01/maintenance github.com/Azure/azure-sdk-for-go/services/managedservices/mgmt/2019-06-01/managedservices -github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb github.com/Azure/azure-sdk-for-go/services/marketplaceordering/mgmt/2015-06-01/marketplaceordering github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media @@ -228,6 +227,8 @@ github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2021-09 github.com/hashicorp/go-azure-sdk/resource-manager/iotcentral/2021-11-01-preview/apps github.com/hashicorp/go-azure-sdk/resource-manager/loadtestservice/2021-12-01-preview/loadtests github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity +github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts +github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2021-01-01/resource github.com/hashicorp/go-azure-sdk/resource-manager/notificationhubs/2017-04-01/namespaces github.com/hashicorp/go-azure-sdk/resource-manager/notificationhubs/2017-04-01/notificationhubs