From 9a7b30949faf21d3ada33f3c308a960876d28a11 Mon Sep 17 00:00:00 2001 From: Mateusz Haligowski Date: Sun, 26 Nov 2023 19:53:14 -0800 Subject: [PATCH 01/74] Add an SDK client for Cache Rules --- internal/services/containers/client/client.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/services/containers/client/client.go b/internal/services/containers/client/client.go index 62126ab5afd9..2637bb249fad 100644 --- a/internal/services/containers/client/client.go +++ b/internal/services/containers/client/client.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2023-05-01/containerinstance" containerregistry_v2019_06_01_preview "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2019-06-01-preview" containerregistry_v2021_08_01_preview "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2019-08-01/containerservices" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-09-02-preview/agentpools" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-09-02-preview/maintenanceconfigurations" @@ -25,6 +26,7 @@ import ( type Client struct { AgentPoolsClient *agentpools.AgentPoolsClient + CacheRulesClient *cacherules.CacheRulesClient ContainerInstanceClient *containerinstance.ContainerInstanceClient ContainerRegistryClient_v2021_08_01_preview *containerregistry_v2021_08_01_preview.Client // v2019_06_01_preview is needed for container registry agent pools and tasks From f5d817b8b785de02acd0f73884edd2cf4f03ee2c Mon Sep 17 00:00:00 2001 From: Mateusz Haligowski Date: Sun, 26 Nov 2023 19:59:10 -0800 Subject: [PATCH 02/74] Synch vendor directory --- .../2023-07-01/cacherules/README.md | 99 +++++++++++++ .../2023-07-01/cacherules/client.go | 26 ++++ .../2023-07-01/cacherules/constants.go | 63 ++++++++ .../2023-07-01/cacherules/id_cacherule.go | 140 ++++++++++++++++++ .../2023-07-01/cacherules/id_registry.go | 127 ++++++++++++++++ .../2023-07-01/cacherules/method_create.go | 74 +++++++++ .../2023-07-01/cacherules/method_delete.go | 70 +++++++++ .../2023-07-01/cacherules/method_get.go | 51 +++++++ .../2023-07-01/cacherules/method_list.go | 89 +++++++++++ .../2023-07-01/cacherules/method_update.go | 74 +++++++++ .../2023-07-01/cacherules/model_cacherule.go | 16 ++ .../cacherules/model_cacheruleproperties.go | 30 ++++ .../model_cacheruleupdateparameters.go | 8 + .../model_cacheruleupdateproperties.go | 8 + .../2023-07-01/cacherules/predicates.go | 27 ++++ .../2023-07-01/cacherules/version.go | 12 ++ vendor/modules.txt | 1 + 17 files changed, 915 insertions(+) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_cacherule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_registry.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_create.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacherule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacheruleproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacheruleupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacheruleupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/version.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/README.md new file mode 100644 index 000000000000..c3a022566c98 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/README.md @@ -0,0 +1,99 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules` Documentation + +The `cacherules` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/cacherules" +``` + + +### Client Initialization + +```go +client := cacherules.NewCacheRulesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `CacheRulesClient.Create` + +```go +ctx := context.TODO() +id := cacherules.NewCacheRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "cacheRuleValue") + +payload := cacherules.CacheRule{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CacheRulesClient.Delete` + +```go +ctx := context.TODO() +id := cacherules.NewCacheRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "cacheRuleValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CacheRulesClient.Get` + +```go +ctx := context.TODO() +id := cacherules.NewCacheRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "cacheRuleValue") + +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: `CacheRulesClient.List` + +```go +ctx := context.TODO() +id := cacherules.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `CacheRulesClient.Update` + +```go +ctx := context.TODO() +id := cacherules.NewCacheRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "cacheRuleValue") + +payload := cacherules.CacheRuleUpdateParameters{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/client.go new file mode 100644 index 000000000000..8a3c87e0787b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/client.go @@ -0,0 +1,26 @@ +package cacherules + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CacheRulesClient struct { + Client *resourcemanager.Client +} + +func NewCacheRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*CacheRulesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "cacherules", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating CacheRulesClient: %+v", err) + } + + return &CacheRulesClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/constants.go new file mode 100644 index 000000000000..bfd55c0bb736 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/constants.go @@ -0,0 +1,63 @@ +package cacherules + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_cacherule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_cacherule.go new file mode 100644 index 000000000000..ffa12165199e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_cacherule.go @@ -0,0 +1,140 @@ +package cacherules + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = CacheRuleId{} + +// CacheRuleId is a struct representing the Resource ID for a Cache Rule +type CacheRuleId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string + CacheRuleName string +} + +// NewCacheRuleID returns a new CacheRuleId struct +func NewCacheRuleID(subscriptionId string, resourceGroupName string, registryName string, cacheRuleName string) CacheRuleId { + return CacheRuleId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + CacheRuleName: cacheRuleName, + } +} + +// ParseCacheRuleID parses 'input' into a CacheRuleId +func ParseCacheRuleID(input string) (*CacheRuleId, error) { + parser := resourceids.NewParserFromResourceIdType(CacheRuleId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CacheRuleId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.CacheRuleName, ok = parsed.Parsed["cacheRuleName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "cacheRuleName", *parsed) + } + + return &id, nil +} + +// ParseCacheRuleIDInsensitively parses 'input' case-insensitively into a CacheRuleId +// note: this method should only be used for API response data and not user input +func ParseCacheRuleIDInsensitively(input string) (*CacheRuleId, error) { + parser := resourceids.NewParserFromResourceIdType(CacheRuleId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CacheRuleId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.CacheRuleName, ok = parsed.Parsed["cacheRuleName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "cacheRuleName", *parsed) + } + + return &id, nil +} + +// ValidateCacheRuleID checks that 'input' can be parsed as a Cache Rule ID +func ValidateCacheRuleID(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 := ParseCacheRuleID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Cache Rule ID +func (id CacheRuleId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/cacheRules/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.CacheRuleName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Cache Rule ID +func (id CacheRuleId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + resourceids.StaticSegment("staticCacheRules", "cacheRules", "cacheRules"), + resourceids.UserSpecifiedSegment("cacheRuleName", "cacheRuleValue"), + } +} + +// String returns a human-readable description of this Cache Rule ID +func (id CacheRuleId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + fmt.Sprintf("Cache Rule Name: %q", id.CacheRuleName), + } + return fmt.Sprintf("Cache Rule (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_registry.go new file mode 100644 index 000000000000..7b505f5e932c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_registry.go @@ -0,0 +1,127 @@ +package cacherules + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = RegistryId{} + +// RegistryId is a struct representing the Resource ID for a Registry +type RegistryId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string +} + +// NewRegistryID returns a new RegistryId struct +func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { + return RegistryId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + } +} + +// ParseRegistryID parses 'input' into a RegistryId +func ParseRegistryID(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId +// note: this method should only be used for API response data and not user input +func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ValidateRegistryID checks that 'input' can be parsed as a Registry ID +func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Registry ID +func (id RegistryId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Registry ID +func (id RegistryId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + } +} + +// String returns a human-readable description of this Registry ID +func (id RegistryId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + } + return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_create.go new file mode 100644 index 000000000000..a61f1944242f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_create.go @@ -0,0 +1,74 @@ +package cacherules + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Create ... +func (c CacheRulesClient) Create(ctx context.Context, id CacheRuleId, input CacheRule) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c CacheRulesClient) CreateThenPoll(ctx context.Context, id CacheRuleId, input CacheRule) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_delete.go new file mode 100644 index 000000000000..c7c73071543c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_delete.go @@ -0,0 +1,70 @@ +package cacherules + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c CacheRulesClient) Delete(ctx context.Context, id CacheRuleId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c CacheRulesClient) DeleteThenPoll(ctx context.Context, id CacheRuleId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_get.go new file mode 100644 index 000000000000..ccfba814ee34 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_get.go @@ -0,0 +1,51 @@ +package cacherules + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *CacheRule +} + +// Get ... +func (c CacheRulesClient) Get(ctx context.Context, id CacheRuleId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_list.go new file mode 100644 index 000000000000..924f369db856 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_list.go @@ -0,0 +1,89 @@ +package cacherules + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]CacheRule +} + +type ListCompleteResult struct { + Items []CacheRule +} + +// List ... +func (c CacheRulesClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/cacheRules", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]CacheRule `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c CacheRulesClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, CacheRuleOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c CacheRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate CacheRuleOperationPredicate) (result ListCompleteResult, err error) { + items := make([]CacheRule, 0) + + resp, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_update.go new file mode 100644 index 000000000000..46078cdbf676 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_update.go @@ -0,0 +1,74 @@ +package cacherules + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Update ... +func (c CacheRulesClient) Update(ctx context.Context, id CacheRuleId, input CacheRuleUpdateParameters) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c CacheRulesClient) UpdateThenPoll(ctx context.Context, id CacheRuleId, input CacheRuleUpdateParameters) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacherule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacherule.go new file mode 100644 index 000000000000..b7301bd69709 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacherule.go @@ -0,0 +1,16 @@ +package cacherules + +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 CacheRule struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *CacheRuleProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacheruleproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacheruleproperties.go new file mode 100644 index 000000000000..1da551d094c8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacheruleproperties.go @@ -0,0 +1,30 @@ +package cacherules + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CacheRuleProperties struct { + CreationDate *string `json:"creationDate,omitempty"` + CredentialSetResourceId *string `json:"credentialSetResourceId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceRepository *string `json:"sourceRepository,omitempty"` + TargetRepository *string `json:"targetRepository,omitempty"` +} + +func (o *CacheRuleProperties) GetCreationDateAsTime() (*time.Time, error) { + if o.CreationDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *CacheRuleProperties) SetCreationDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationDate = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacheruleupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacheruleupdateparameters.go new file mode 100644 index 000000000000..6186726ad343 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacheruleupdateparameters.go @@ -0,0 +1,8 @@ +package cacherules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CacheRuleUpdateParameters struct { + Properties *CacheRuleUpdateProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacheruleupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacheruleupdateproperties.go new file mode 100644 index 000000000000..4625c7191645 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/model_cacheruleupdateproperties.go @@ -0,0 +1,8 @@ +package cacherules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CacheRuleUpdateProperties struct { + CredentialSetResourceId *string `json:"credentialSetResourceId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/predicates.go new file mode 100644 index 000000000000..f629c22e2448 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/predicates.go @@ -0,0 +1,27 @@ +package cacherules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CacheRuleOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p CacheRuleOperationPredicate) Matches(input CacheRule) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/version.go new file mode 100644 index 000000000000..92ef098585db --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/version.go @@ -0,0 +1,12 @@ +package cacherules + +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 = "2023-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/cacherules/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 8feb186f7dcf..24c8b791d809 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -378,6 +378,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01- github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/scopemaps github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/tokens github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/webhooks +github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2019-08-01/containerservices github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-03-02-preview github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-03-02-preview/agentpools From abb42112a1a367910e3b35a0ac145aa297c47ad0 Mon Sep 17 00:00:00 2001 From: Mateusz Haligowski Date: Sun, 26 Nov 2023 20:41:52 -0800 Subject: [PATCH 03/74] Generate parser and validator --- .../parse/container_registry_cache_rule.go | 78 +++++++++++ .../container_registry_cache_rule_test.go | 131 ++++++++++++++++++ internal/services/containers/resourceids.go | 1 + .../container_registry_cache_rule_id.go | 26 ++++ .../container_registry_cache_rule_id_test.go | 91 ++++++++++++ 5 files changed, 327 insertions(+) create mode 100644 internal/services/containers/parse/container_registry_cache_rule.go create mode 100644 internal/services/containers/parse/container_registry_cache_rule_test.go create mode 100644 internal/services/containers/validate/container_registry_cache_rule_id.go create mode 100644 internal/services/containers/validate/container_registry_cache_rule_id_test.go diff --git a/internal/services/containers/parse/container_registry_cache_rule.go b/internal/services/containers/parse/container_registry_cache_rule.go new file mode 100644 index 000000000000..57a79cca8717 --- /dev/null +++ b/internal/services/containers/parse/container_registry_cache_rule.go @@ -0,0 +1,78 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package parse + +// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +type ContainerRegistryCacheRuleId struct { + SubscriptionId string + ResourceGroup string + RegistryName string + CacheRuleName string +} + +func NewContainerRegistryCacheRuleID(subscriptionId, resourceGroup, registryName, cacheRuleName string) ContainerRegistryCacheRuleId { + return ContainerRegistryCacheRuleId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + RegistryName: registryName, + CacheRuleName: cacheRuleName, + } +} + +func (id ContainerRegistryCacheRuleId) String() string { + segments := []string{ + fmt.Sprintf("Cache Rule Name %q", id.CacheRuleName), + fmt.Sprintf("Registry Name %q", id.RegistryName), + fmt.Sprintf("Resource Group %q", id.ResourceGroup), + } + segmentsStr := strings.Join(segments, " / ") + return fmt.Sprintf("%s: (%s)", "Container Registry Cache Rule", segmentsStr) +} + +func (id ContainerRegistryCacheRuleId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/cacheRules/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.RegistryName, id.CacheRuleName) +} + +// ContainerRegistryCacheRuleID parses a ContainerRegistryCacheRule ID into an ContainerRegistryCacheRuleId struct +func ContainerRegistryCacheRuleID(input string) (*ContainerRegistryCacheRuleId, error) { + id, err := resourceids.ParseAzureResourceID(input) + if err != nil { + return nil, fmt.Errorf("parsing %q as an ContainerRegistryCacheRule ID: %+v", input, err) + } + + resourceId := ContainerRegistryCacheRuleId{ + SubscriptionId: id.SubscriptionID, + ResourceGroup: id.ResourceGroup, + } + + if resourceId.SubscriptionId == "" { + return nil, fmt.Errorf("ID was missing the 'subscriptions' element") + } + + if resourceId.ResourceGroup == "" { + return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") + } + + if resourceId.RegistryName, err = id.PopSegment("registries"); err != nil { + return nil, err + } + if resourceId.CacheRuleName, err = id.PopSegment("cacheRules"); err != nil { + return nil, err + } + + if err := id.ValidateNoEmptySegments(input); err != nil { + return nil, err + } + + return &resourceId, nil +} diff --git a/internal/services/containers/parse/container_registry_cache_rule_test.go b/internal/services/containers/parse/container_registry_cache_rule_test.go new file mode 100644 index 000000000000..64e051e82eff --- /dev/null +++ b/internal/services/containers/parse/container_registry_cache_rule_test.go @@ -0,0 +1,131 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package parse + +// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.Id = ContainerRegistryCacheRuleId{} + +func TestContainerRegistryCacheRuleIDFormatter(t *testing.T) { + actual := NewContainerRegistryCacheRuleID("12345678-1234-9876-4563-123456789012", "group1", "registry1", "rule1").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/cacheRules/rule1" + if actual != expected { + t.Fatalf("Expected %q but got %q", expected, actual) + } +} + +func TestContainerRegistryCacheRuleID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *ContainerRegistryCacheRuleId + }{ + + { + // empty + Input: "", + Error: true, + }, + + { + // missing SubscriptionId + Input: "/", + Error: true, + }, + + { + // missing value for SubscriptionId + Input: "/subscriptions/", + Error: true, + }, + + { + // missing ResourceGroup + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", + Error: true, + }, + + { + // missing value for ResourceGroup + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", + Error: true, + }, + + { + // missing RegistryName + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/", + Error: true, + }, + + { + // missing value for RegistryName + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/", + Error: true, + }, + + { + // missing CacheRuleName + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/", + Error: true, + }, + + { + // missing value for CacheRuleName + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/cacheRules/", + Error: true, + }, + + { + // valid + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/cacheRules/rule1", + Expected: &ContainerRegistryCacheRuleId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroup: "group1", + RegistryName: "registry1", + CacheRuleName: "rule1", + }, + }, + + { + // upper-cased + Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/GROUP1/PROVIDERS/MICROSOFT.CONTAINERREGISTRY/REGISTRIES/REGISTRY1/CACHERULES/RULE1", + Error: true, + }, + } + + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ContainerRegistryCacheRuleID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %s", 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.ResourceGroup != v.Expected.ResourceGroup { + t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) + } + if actual.RegistryName != v.Expected.RegistryName { + t.Fatalf("Expected %q but got %q for RegistryName", v.Expected.RegistryName, actual.RegistryName) + } + if actual.CacheRuleName != v.Expected.CacheRuleName { + t.Fatalf("Expected %q but got %q for CacheRuleName", v.Expected.CacheRuleName, actual.CacheRuleName) + } + } +} diff --git a/internal/services/containers/resourceids.go b/internal/services/containers/resourceids.go index 3a48ea7ec943..519da777ec49 100644 --- a/internal/services/containers/resourceids.go +++ b/internal/services/containers/resourceids.go @@ -5,5 +5,6 @@ package containers //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=Cluster -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=NodePool -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool1 +//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=ContainerRegistryCacheRule -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/cacheRules/rule1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=ContainerRegistryTaskSchedule -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/tasks/task1/schedule/schedule1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=ContainerRegistryTokenPassword -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.ContainerRegistry/registries/registry1/tokens/token1/passwords/password diff --git a/internal/services/containers/validate/container_registry_cache_rule_id.go b/internal/services/containers/validate/container_registry_cache_rule_id.go new file mode 100644 index 000000000000..71925851414f --- /dev/null +++ b/internal/services/containers/validate/container_registry_cache_rule_id.go @@ -0,0 +1,26 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package validate + +// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten + +import ( + "fmt" + + "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/parse" +) + +func ContainerRegistryCacheRuleID(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 := parse.ContainerRegistryCacheRuleID(v); err != nil { + errors = append(errors, err) + } + + return +} diff --git a/internal/services/containers/validate/container_registry_cache_rule_id_test.go b/internal/services/containers/validate/container_registry_cache_rule_id_test.go new file mode 100644 index 000000000000..ae8770f3d9e3 --- /dev/null +++ b/internal/services/containers/validate/container_registry_cache_rule_id_test.go @@ -0,0 +1,91 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package validate + +// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten + +import "testing" + +func TestContainerRegistryCacheRuleID(t *testing.T) { + cases := []struct { + Input string + Valid bool + }{ + + { + // empty + Input: "", + Valid: false, + }, + + { + // missing SubscriptionId + Input: "/", + Valid: false, + }, + + { + // missing value for SubscriptionId + Input: "/subscriptions/", + Valid: false, + }, + + { + // missing ResourceGroup + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", + Valid: false, + }, + + { + // missing value for ResourceGroup + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", + Valid: false, + }, + + { + // missing RegistryName + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/", + Valid: false, + }, + + { + // missing value for RegistryName + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/", + Valid: false, + }, + + { + // missing CacheRuleName + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/", + Valid: false, + }, + + { + // missing value for CacheRuleName + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/cacheRules/", + Valid: false, + }, + + { + // valid + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/cacheRules/rule1", + Valid: true, + }, + + { + // upper-cased + Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/GROUP1/PROVIDERS/MICROSOFT.CONTAINERREGISTRY/REGISTRIES/REGISTRY1/CACHERULES/RULE1", + Valid: false, + }, + } + for _, tc := range cases { + t.Logf("[DEBUG] Testing Value %s", tc.Input) + _, errors := ContainerRegistryCacheRuleID(tc.Input, "test") + valid := len(errors) == 0 + + if tc.Valid != valid { + t.Fatalf("Expected %t but got %t", tc.Valid, valid) + } + } +} From 65cdac2f11a0180e5f971ea2b7eb13810a84b3f4 Mon Sep 17 00:00:00 2001 From: Mateusz Haligowski Date: Sun, 26 Nov 2023 21:49:09 -0800 Subject: [PATCH 04/74] Verify the name of the cache rule --- .../container_registry_cache_rule.go | 62 ++ .../container_registry_cache_rule_test.go | 73 ++ .../container_registry_cache_rule_name.go | 27 + .../2023-07-01/registries/README.md | 236 ++++++ .../2023-07-01/registries/client.go | 26 + .../2023-07-01/registries/constants.go | 772 ++++++++++++++++++ .../registries/id_privatelinkresource.go | 140 ++++ .../2023-07-01/registries/id_registry.go | 127 +++ .../2023-07-01/registries/method_create.go | 74 ++ .../2023-07-01/registries/method_delete.go | 71 ++ .../registries/method_generatecredentials.go | 74 ++ .../2023-07-01/registries/method_get.go | 51 ++ .../method_getprivatelinkresource.go | 51 ++ .../registries/method_importimage.go | 74 ++ .../2023-07-01/registries/method_list.go | 90 ++ .../registries/method_listbyresourcegroup.go | 90 ++ .../registries/method_listcredentials.go | 52 ++ .../method_listprivatelinkresources.go | 89 ++ .../registries/method_listusages.go | 52 ++ .../registries/method_regeneratecredential.go | 56 ++ .../2023-07-01/registries/method_update.go | 74 ++ .../registries/model_encryptionproperty.go | 9 + .../registries/model_exportpolicy.go | 8 + .../model_generatecredentialsparameters.go | 28 + .../model_generatecredentialsresult.go | 9 + .../registries/model_importimageparameters.go | 11 + .../registries/model_importsource.go | 11 + .../model_importsourcecredentials.go | 9 + .../2023-07-01/registries/model_iprule.go | 9 + .../registries/model_keyvaultproperties.go | 30 + .../registries/model_networkruleset.go | 9 + .../2023-07-01/registries/model_policies.go | 11 + .../registries/model_privateendpoint.go | 8 + .../model_privateendpointconnection.go | 16 + ...del_privateendpointconnectionproperties.go | 10 + .../registries/model_privatelinkresource.go | 11 + .../model_privatelinkresourceproperties.go | 10 + ...model_privatelinkserviceconnectionstate.go | 10 + .../registries/model_quarantinepolicy.go | 8 + .../model_regeneratecredentialparameters.go | 8 + .../2023-07-01/registries/model_registry.go | 21 + .../model_registrylistcredentialsresult.go | 9 + .../registries/model_registrypassword.go | 9 + .../registries/model_registryproperties.go | 39 + ...odel_registrypropertiesupdateparameters.go | 14 + .../model_registryupdateparameters.go | 15 + .../registries/model_registryusage.go | 11 + .../model_registryusagelistresult.go | 8 + .../registries/model_retentionpolicy.go | 28 + .../2023-07-01/registries/model_sku.go | 9 + .../2023-07-01/registries/model_status.go | 28 + .../registries/model_tokenpassword.go | 41 + .../registries/model_trustpolicy.go | 9 + .../2023-07-01/registries/predicates.go | 55 ++ .../2023-07-01/registries/version.go | 12 + vendor/modules.txt | 1 + 56 files changed, 2895 insertions(+) create mode 100644 internal/services/containers/container_registry_cache_rule.go create mode 100644 internal/services/containers/container_registry_cache_rule_test.go create mode 100644 internal/services/containers/validate/container_registry_cache_rule_name.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_registry.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_create.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_generatecredentials.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_getprivatelinkresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_importimage.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listbyresourcegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listcredentials.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listprivatelinkresources.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listusages.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_regeneratecredential.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_encryptionproperty.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_exportpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importimageparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsourcecredentials.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_iprule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_keyvaultproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_networkruleset.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_policies.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpoint.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnectionproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkserviceconnectionstate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_quarantinepolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_regeneratecredentialparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registry.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrylistcredentialsresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypassword.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypropertiesupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusage.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusagelistresult.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_retentionpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_sku.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_status.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_tokenpassword.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_trustpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/version.go diff --git a/internal/services/containers/container_registry_cache_rule.go b/internal/services/containers/container_registry_cache_rule.go new file mode 100644 index 000000000000..6d77df8d1e0b --- /dev/null +++ b/internal/services/containers/container_registry_cache_rule.go @@ -0,0 +1,62 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package containers + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries" + containerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" +) + +func resourceContainerRegistryCacheRule() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { + _, err := registries.ParseRegistryID(id) + return err + }), + + Timeouts: &pluginsdk.ResourceTimeout{ + Create: pluginsdk.DefaultTimeout(30 * time.Minute), + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + Update: pluginsdk.DefaultTimeout(30 * time.Minute), + Delete: pluginsdk.DefaultTimeout(30 * time.Minute), + }, + + Schema: resourceContainerRegistrySchema(), + } +} + +func resourceContainerRegistryCacheRuleSchema() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + Description: "The name of the cache rule.", + }, + + "registry": { + Type: pluginsdk.TypeString, + Required: true, + Description: "The name of the container registry.", + ValidateFunc: containerValidate.ContainerRegistryName, + }, + + "source_repo": { + Type: pluginsdk.TypeString, + Required: true, + Description: "The full source repository path such as 'docker.io/library/ubuntu'.", + }, + + "target_repo": { + Type: pluginsdk.TypeString, + Required: true, + Description: "The target repository namespace such as 'ubuntu'.", + }, + + "resource_group_name": commonschema.ResourceGroupName(), + } +} diff --git a/internal/services/containers/container_registry_cache_rule_test.go b/internal/services/containers/container_registry_cache_rule_test.go new file mode 100644 index 000000000000..1d386c2e22b2 --- /dev/null +++ b/internal/services/containers/container_registry_cache_rule_test.go @@ -0,0 +1,73 @@ +package containers_test + +import ( + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" +) + +type ContainerRegistryCacheRule struct{} + +func TestAccContainerRegistryCacheRuleName_validation(t *testing.T) { + cases := []struct { + Value string + ErrCount int + }{ + { + Value: "", + ErrCount: 2, + }, + { + Value: "four", + ErrCount: 1, + }, + { + Value: "5five", + ErrCount: 0, + }, + { + Value: "hello-world", + ErrCount: 0, + }, + { + Value: "hello-world-foo-bar-12345", + ErrCount: 0, + }, + { + Value: "hello_world", + ErrCount: 1, + }, + { + Value: "helloWorld", + ErrCount: 0, + }, + { + Value: "helloworld12", + ErrCount: 0, + }, + { + Value: "hello@world", + ErrCount: 1, + }, + { + Value: "qfvbdsbvipqdbwsbddbdcwqffewsqwcdw21ddwqwd3324120", + ErrCount: 0, + }, + { + Value: "qfvbdsbvipqdbwsbddbdcwqffewsqwcdw21ddwqwd33241202", + ErrCount: 0, + }, + { + Value: "qfvbdsbvipqdbwsbddbdcwqfjjfewsqwcdw21ddwqwd3324120", + ErrCount: 1, + }, + } + + for _, tc := range cases { + _, errors := validate.ContainerRegistryCacheRuleName(tc.Value, "azurerm_container_registry_cache_rule") + + if len(errors) != tc.ErrCount { + t.Fatalf("Expected the Azure RM Container Registry Cache Rule Name to trigger a validation error: %v", errors) + } + } +} diff --git a/internal/services/containers/validate/container_registry_cache_rule_name.go b/internal/services/containers/validate/container_registry_cache_rule_name.go new file mode 100644 index 000000000000..834e89a9640b --- /dev/null +++ b/internal/services/containers/validate/container_registry_cache_rule_name.go @@ -0,0 +1,27 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package validate + +import ( + "fmt" + "regexp" +) + +func ContainerRegistryCacheRuleName(v interface{}, k string) (warnings []string, errors []error) { + value := v.(string) + if !regexp.MustCompile(`^[a-zA-Z0-9-]+$`).MatchString(value) { + errors = append(errors, fmt.Errorf( + "alpha numeric characters optionally separated by '-' only are allowed in %q: %q", k, value)) + } + + if 5 > len(value) { + errors = append(errors, fmt.Errorf("%q cannot be less than 5 characters: %q", k, value)) + } + + if len(value) >= 50 { + errors = append(errors, fmt.Errorf("%q cannot be longer than 50 characters: %q %d", k, value, len(value))) + } + + return warnings, errors +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/README.md new file mode 100644 index 000000000000..88ddb567f0fb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/README.md @@ -0,0 +1,236 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries` Documentation + +The `registries` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/registries" +``` + + +### Client Initialization + +```go +client := registries.NewRegistriesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `RegistriesClient.Create` + +```go +ctx := context.TODO() +id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +payload := registries.Registry{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `RegistriesClient.Delete` + +```go +ctx := context.TODO() +id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `RegistriesClient.GenerateCredentials` + +```go +ctx := context.TODO() +id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +payload := registries.GenerateCredentialsParameters{ + // ... +} + + +if err := client.GenerateCredentialsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `RegistriesClient.Get` + +```go +ctx := context.TODO() +id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +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: `RegistriesClient.GetPrivateLinkResource` + +```go +ctx := context.TODO() +id := registries.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "privateLinkResourceValue") + +read, err := client.GetPrivateLinkResource(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RegistriesClient.ImportImage` + +```go +ctx := context.TODO() +id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +payload := registries.ImportImageParameters{ + // ... +} + + +if err := client.ImportImageThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `RegistriesClient.List` + +```go +ctx := context.TODO() +id := registries.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `RegistriesClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := registries.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `RegistriesClient.ListCredentials` + +```go +ctx := context.TODO() +id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +read, err := client.ListCredentials(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RegistriesClient.ListPrivateLinkResources` + +```go +ctx := context.TODO() +id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +// alternatively `client.ListPrivateLinkResources(ctx, id)` can be used to do batched pagination +items, err := client.ListPrivateLinkResourcesComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `RegistriesClient.ListUsages` + +```go +ctx := context.TODO() +id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +read, err := client.ListUsages(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RegistriesClient.RegenerateCredential` + +```go +ctx := context.TODO() +id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +payload := registries.RegenerateCredentialParameters{ + // ... +} + + +read, err := client.RegenerateCredential(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RegistriesClient.Update` + +```go +ctx := context.TODO() +id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +payload := registries.RegistryUpdateParameters{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/client.go new file mode 100644 index 000000000000..f3defc5ecd2e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/client.go @@ -0,0 +1,26 @@ +package registries + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistriesClient struct { + Client *resourcemanager.Client +} + +func NewRegistriesClientWithBaseURI(sdkApi sdkEnv.Api) (*RegistriesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "registries", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating RegistriesClient: %+v", err) + } + + return &RegistriesClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/constants.go new file mode 100644 index 000000000000..2f605a8d6bcf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/constants.go @@ -0,0 +1,772 @@ +package registries + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Action string + +const ( + ActionAllow Action = "Allow" +) + +func PossibleValuesForAction() []string { + return []string{ + string(ActionAllow), + } +} + +func (s *Action) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAction(input string) (*Action, error) { + vals := map[string]Action{ + "allow": ActionAllow, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Action(input) + return &out, nil +} + +type ActionsRequired string + +const ( + ActionsRequiredNone ActionsRequired = "None" + ActionsRequiredRecreate ActionsRequired = "Recreate" +) + +func PossibleValuesForActionsRequired() []string { + return []string{ + string(ActionsRequiredNone), + string(ActionsRequiredRecreate), + } +} + +func (s *ActionsRequired) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseActionsRequired(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseActionsRequired(input string) (*ActionsRequired, error) { + vals := map[string]ActionsRequired{ + "none": ActionsRequiredNone, + "recreate": ActionsRequiredRecreate, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ActionsRequired(input) + return &out, nil +} + +type ConnectionStatus string + +const ( + ConnectionStatusApproved ConnectionStatus = "Approved" + ConnectionStatusDisconnected ConnectionStatus = "Disconnected" + ConnectionStatusPending ConnectionStatus = "Pending" + ConnectionStatusRejected ConnectionStatus = "Rejected" +) + +func PossibleValuesForConnectionStatus() []string { + return []string{ + string(ConnectionStatusApproved), + string(ConnectionStatusDisconnected), + string(ConnectionStatusPending), + string(ConnectionStatusRejected), + } +} + +func (s *ConnectionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseConnectionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseConnectionStatus(input string) (*ConnectionStatus, error) { + vals := map[string]ConnectionStatus{ + "approved": ConnectionStatusApproved, + "disconnected": ConnectionStatusDisconnected, + "pending": ConnectionStatusPending, + "rejected": ConnectionStatusRejected, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ConnectionStatus(input) + return &out, nil +} + +type DefaultAction string + +const ( + DefaultActionAllow DefaultAction = "Allow" + DefaultActionDeny DefaultAction = "Deny" +) + +func PossibleValuesForDefaultAction() []string { + return []string{ + string(DefaultActionAllow), + string(DefaultActionDeny), + } +} + +func (s *DefaultAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDefaultAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDefaultAction(input string) (*DefaultAction, error) { + vals := map[string]DefaultAction{ + "allow": DefaultActionAllow, + "deny": DefaultActionDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DefaultAction(input) + return &out, nil +} + +type EncryptionStatus string + +const ( + EncryptionStatusDisabled EncryptionStatus = "disabled" + EncryptionStatusEnabled EncryptionStatus = "enabled" +) + +func PossibleValuesForEncryptionStatus() []string { + return []string{ + string(EncryptionStatusDisabled), + string(EncryptionStatusEnabled), + } +} + +func (s *EncryptionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEncryptionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEncryptionStatus(input string) (*EncryptionStatus, error) { + vals := map[string]EncryptionStatus{ + "disabled": EncryptionStatusDisabled, + "enabled": EncryptionStatusEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EncryptionStatus(input) + return &out, nil +} + +type ExportPolicyStatus string + +const ( + ExportPolicyStatusDisabled ExportPolicyStatus = "disabled" + ExportPolicyStatusEnabled ExportPolicyStatus = "enabled" +) + +func PossibleValuesForExportPolicyStatus() []string { + return []string{ + string(ExportPolicyStatusDisabled), + string(ExportPolicyStatusEnabled), + } +} + +func (s *ExportPolicyStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExportPolicyStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExportPolicyStatus(input string) (*ExportPolicyStatus, error) { + vals := map[string]ExportPolicyStatus{ + "disabled": ExportPolicyStatusDisabled, + "enabled": ExportPolicyStatusEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExportPolicyStatus(input) + return &out, nil +} + +type ImportMode string + +const ( + ImportModeForce ImportMode = "Force" + ImportModeNoForce ImportMode = "NoForce" +) + +func PossibleValuesForImportMode() []string { + return []string{ + string(ImportModeForce), + string(ImportModeNoForce), + } +} + +func (s *ImportMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseImportMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseImportMode(input string) (*ImportMode, error) { + vals := map[string]ImportMode{ + "force": ImportModeForce, + "noforce": ImportModeNoForce, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ImportMode(input) + return &out, nil +} + +type NetworkRuleBypassOptions string + +const ( + NetworkRuleBypassOptionsAzureServices NetworkRuleBypassOptions = "AzureServices" + NetworkRuleBypassOptionsNone NetworkRuleBypassOptions = "None" +) + +func PossibleValuesForNetworkRuleBypassOptions() []string { + return []string{ + string(NetworkRuleBypassOptionsAzureServices), + string(NetworkRuleBypassOptionsNone), + } +} + +func (s *NetworkRuleBypassOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkRuleBypassOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkRuleBypassOptions(input string) (*NetworkRuleBypassOptions, error) { + vals := map[string]NetworkRuleBypassOptions{ + "azureservices": NetworkRuleBypassOptionsAzureServices, + "none": NetworkRuleBypassOptionsNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkRuleBypassOptions(input) + return &out, nil +} + +type PasswordName string + +const ( + PasswordNamePassword PasswordName = "password" + PasswordNamePasswordTwo PasswordName = "password2" +) + +func PossibleValuesForPasswordName() []string { + return []string{ + string(PasswordNamePassword), + string(PasswordNamePasswordTwo), + } +} + +func (s *PasswordName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePasswordName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePasswordName(input string) (*PasswordName, error) { + vals := map[string]PasswordName{ + "password": PasswordNamePassword, + "password2": PasswordNamePasswordTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PasswordName(input) + return &out, nil +} + +type PolicyStatus string + +const ( + PolicyStatusDisabled PolicyStatus = "disabled" + PolicyStatusEnabled PolicyStatus = "enabled" +) + +func PossibleValuesForPolicyStatus() []string { + return []string{ + string(PolicyStatusDisabled), + string(PolicyStatusEnabled), + } +} + +func (s *PolicyStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePolicyStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePolicyStatus(input string) (*PolicyStatus, error) { + vals := map[string]PolicyStatus{ + "disabled": PolicyStatusDisabled, + "enabled": PolicyStatusEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PolicyStatus(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicNetworkAccess string + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +func PossibleValuesForPublicNetworkAccess() []string { + return []string{ + string(PublicNetworkAccessDisabled), + string(PublicNetworkAccessEnabled), + } +} + +func (s *PublicNetworkAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicNetworkAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicNetworkAccess(input string) (*PublicNetworkAccess, error) { + vals := map[string]PublicNetworkAccess{ + "disabled": PublicNetworkAccessDisabled, + "enabled": PublicNetworkAccessEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicNetworkAccess(input) + return &out, nil +} + +type RegistryUsageUnit string + +const ( + RegistryUsageUnitBytes RegistryUsageUnit = "Bytes" + RegistryUsageUnitCount RegistryUsageUnit = "Count" +) + +func PossibleValuesForRegistryUsageUnit() []string { + return []string{ + string(RegistryUsageUnitBytes), + string(RegistryUsageUnitCount), + } +} + +func (s *RegistryUsageUnit) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryUsageUnit(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryUsageUnit(input string) (*RegistryUsageUnit, error) { + vals := map[string]RegistryUsageUnit{ + "bytes": RegistryUsageUnitBytes, + "count": RegistryUsageUnitCount, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryUsageUnit(input) + return &out, nil +} + +type SkuName string + +const ( + SkuNameBasic SkuName = "Basic" + SkuNameClassic SkuName = "Classic" + SkuNamePremium SkuName = "Premium" + SkuNameStandard SkuName = "Standard" +) + +func PossibleValuesForSkuName() []string { + return []string{ + string(SkuNameBasic), + string(SkuNameClassic), + string(SkuNamePremium), + string(SkuNameStandard), + } +} + +func (s *SkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSkuName(input string) (*SkuName, error) { + vals := map[string]SkuName{ + "basic": SkuNameBasic, + "classic": SkuNameClassic, + "premium": SkuNamePremium, + "standard": SkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SkuName(input) + return &out, nil +} + +type SkuTier string + +const ( + SkuTierBasic SkuTier = "Basic" + SkuTierClassic SkuTier = "Classic" + SkuTierPremium SkuTier = "Premium" + SkuTierStandard SkuTier = "Standard" +) + +func PossibleValuesForSkuTier() []string { + return []string{ + string(SkuTierBasic), + string(SkuTierClassic), + string(SkuTierPremium), + string(SkuTierStandard), + } +} + +func (s *SkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSkuTier(input string) (*SkuTier, error) { + vals := map[string]SkuTier{ + "basic": SkuTierBasic, + "classic": SkuTierClassic, + "premium": SkuTierPremium, + "standard": SkuTierStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SkuTier(input) + return &out, nil +} + +type TokenPasswordName string + +const ( + TokenPasswordNamePasswordOne TokenPasswordName = "password1" + TokenPasswordNamePasswordTwo TokenPasswordName = "password2" +) + +func PossibleValuesForTokenPasswordName() []string { + return []string{ + string(TokenPasswordNamePasswordOne), + string(TokenPasswordNamePasswordTwo), + } +} + +func (s *TokenPasswordName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTokenPasswordName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTokenPasswordName(input string) (*TokenPasswordName, error) { + vals := map[string]TokenPasswordName{ + "password1": TokenPasswordNamePasswordOne, + "password2": TokenPasswordNamePasswordTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TokenPasswordName(input) + return &out, nil +} + +type TrustPolicyType string + +const ( + TrustPolicyTypeNotary TrustPolicyType = "Notary" +) + +func PossibleValuesForTrustPolicyType() []string { + return []string{ + string(TrustPolicyTypeNotary), + } +} + +func (s *TrustPolicyType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTrustPolicyType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTrustPolicyType(input string) (*TrustPolicyType, error) { + vals := map[string]TrustPolicyType{ + "notary": TrustPolicyTypeNotary, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TrustPolicyType(input) + return &out, nil +} + +type ZoneRedundancy string + +const ( + ZoneRedundancyDisabled ZoneRedundancy = "Disabled" + ZoneRedundancyEnabled ZoneRedundancy = "Enabled" +) + +func PossibleValuesForZoneRedundancy() []string { + return []string{ + string(ZoneRedundancyDisabled), + string(ZoneRedundancyEnabled), + } +} + +func (s *ZoneRedundancy) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseZoneRedundancy(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseZoneRedundancy(input string) (*ZoneRedundancy, error) { + vals := map[string]ZoneRedundancy{ + "disabled": ZoneRedundancyDisabled, + "enabled": ZoneRedundancyEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ZoneRedundancy(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go new file mode 100644 index 000000000000..1a9ba519f8ad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go @@ -0,0 +1,140 @@ +package registries + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = PrivateLinkResourceId{} + +// PrivateLinkResourceId is a struct representing the Resource ID for a Private Link Resource +type PrivateLinkResourceId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string + PrivateLinkResourceName string +} + +// NewPrivateLinkResourceID returns a new PrivateLinkResourceId struct +func NewPrivateLinkResourceID(subscriptionId string, resourceGroupName string, registryName string, privateLinkResourceName string) PrivateLinkResourceId { + return PrivateLinkResourceId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + PrivateLinkResourceName: privateLinkResourceName, + } +} + +// ParsePrivateLinkResourceID parses 'input' into a PrivateLinkResourceId +func ParsePrivateLinkResourceID(input string) (*PrivateLinkResourceId, error) { + parser := resourceids.NewParserFromResourceIdType(PrivateLinkResourceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := PrivateLinkResourceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.PrivateLinkResourceName, ok = parsed.Parsed["privateLinkResourceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "privateLinkResourceName", *parsed) + } + + return &id, nil +} + +// ParsePrivateLinkResourceIDInsensitively parses 'input' case-insensitively into a PrivateLinkResourceId +// note: this method should only be used for API response data and not user input +func ParsePrivateLinkResourceIDInsensitively(input string) (*PrivateLinkResourceId, error) { + parser := resourceids.NewParserFromResourceIdType(PrivateLinkResourceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := PrivateLinkResourceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.PrivateLinkResourceName, ok = parsed.Parsed["privateLinkResourceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "privateLinkResourceName", *parsed) + } + + return &id, nil +} + +// ValidatePrivateLinkResourceID checks that 'input' can be parsed as a Private Link Resource ID +func ValidatePrivateLinkResourceID(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 := ParsePrivateLinkResourceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Private Link Resource ID +func (id PrivateLinkResourceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/privateLinkResources/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.PrivateLinkResourceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Private Link Resource ID +func (id PrivateLinkResourceId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceValue"), + } +} + +// String returns a human-readable description of this Private Link Resource ID +func (id PrivateLinkResourceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + fmt.Sprintf("Private Link Resource Name: %q", id.PrivateLinkResourceName), + } + return fmt.Sprintf("Private Link Resource (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_registry.go new file mode 100644 index 000000000000..e45e8501b3ff --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_registry.go @@ -0,0 +1,127 @@ +package registries + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = RegistryId{} + +// RegistryId is a struct representing the Resource ID for a Registry +type RegistryId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string +} + +// NewRegistryID returns a new RegistryId struct +func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { + return RegistryId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + } +} + +// ParseRegistryID parses 'input' into a RegistryId +func ParseRegistryID(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId +// note: this method should only be used for API response data and not user input +func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ValidateRegistryID checks that 'input' can be parsed as a Registry ID +func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Registry ID +func (id RegistryId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Registry ID +func (id RegistryId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + } +} + +// String returns a human-readable description of this Registry ID +func (id RegistryId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + } + return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_create.go new file mode 100644 index 000000000000..8ef319b31346 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_create.go @@ -0,0 +1,74 @@ +package registries + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Create ... +func (c RegistriesClient) Create(ctx context.Context, id RegistryId, input Registry) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c RegistriesClient) CreateThenPoll(ctx context.Context, id RegistryId, input Registry) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_delete.go new file mode 100644 index 000000000000..4a0877f344a8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_delete.go @@ -0,0 +1,71 @@ +package registries + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c RegistriesClient) Delete(ctx context.Context, id RegistryId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c RegistriesClient) DeleteThenPoll(ctx context.Context, id RegistryId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_generatecredentials.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_generatecredentials.go new file mode 100644 index 000000000000..6d1429c52b9d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_generatecredentials.go @@ -0,0 +1,74 @@ +package registries + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GenerateCredentialsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// GenerateCredentials ... +func (c RegistriesClient) GenerateCredentials(ctx context.Context, id RegistryId, input GenerateCredentialsParameters) (result GenerateCredentialsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/generateCredentials", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// GenerateCredentialsThenPoll performs GenerateCredentials then polls until it's completed +func (c RegistriesClient) GenerateCredentialsThenPoll(ctx context.Context, id RegistryId, input GenerateCredentialsParameters) error { + result, err := c.GenerateCredentials(ctx, id, input) + if err != nil { + return fmt.Errorf("performing GenerateCredentials: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after GenerateCredentials: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_get.go new file mode 100644 index 000000000000..406a8fb3aec1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_get.go @@ -0,0 +1,51 @@ +package registries + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Registry +} + +// Get ... +func (c RegistriesClient) Get(ctx context.Context, id RegistryId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_getprivatelinkresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_getprivatelinkresource.go new file mode 100644 index 000000000000..484d73f99cd5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_getprivatelinkresource.go @@ -0,0 +1,51 @@ +package registries + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetPrivateLinkResourceOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *PrivateLinkResource +} + +// GetPrivateLinkResource ... +func (c RegistriesClient) GetPrivateLinkResource(ctx context.Context, id PrivateLinkResourceId) (result GetPrivateLinkResourceOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_importimage.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_importimage.go new file mode 100644 index 000000000000..73da0c5ca7b7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_importimage.go @@ -0,0 +1,74 @@ +package registries + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ImportImageOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// ImportImage ... +func (c RegistriesClient) ImportImage(ctx context.Context, id RegistryId, input ImportImageParameters) (result ImportImageOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/importImage", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ImportImageThenPoll performs ImportImage then polls until it's completed +func (c RegistriesClient) ImportImageThenPoll(ctx context.Context, id RegistryId, input ImportImageParameters) error { + result, err := c.ImportImage(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ImportImage: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ImportImage: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_list.go new file mode 100644 index 000000000000..5fab07107b41 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_list.go @@ -0,0 +1,90 @@ +package registries + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Registry +} + +type ListCompleteResult struct { + Items []Registry +} + +// List ... +func (c RegistriesClient) List(ctx context.Context, id commonids.SubscriptionId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ContainerRegistry/registries", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]Registry `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c RegistriesClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, RegistryOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c RegistriesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate RegistryOperationPredicate) (result ListCompleteResult, err error) { + items := make([]Registry, 0) + + resp, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listbyresourcegroup.go new file mode 100644 index 000000000000..e716ed49cfbd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listbyresourcegroup.go @@ -0,0 +1,90 @@ +package registries + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Registry +} + +type ListByResourceGroupCompleteResult struct { + Items []Registry +} + +// ListByResourceGroup ... +func (c RegistriesClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ContainerRegistry/registries", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]Registry `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByResourceGroupComplete retrieves all the results into a single object +func (c RegistriesClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, RegistryOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c RegistriesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate RegistryOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]Registry, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListByResourceGroupCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listcredentials.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listcredentials.go new file mode 100644 index 000000000000..b974a756cdae --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listcredentials.go @@ -0,0 +1,52 @@ +package registries + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListCredentialsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *RegistryListCredentialsResult +} + +// ListCredentials ... +func (c RegistriesClient) ListCredentials(ctx context.Context, id RegistryId) (result ListCredentialsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listCredentials", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listprivatelinkresources.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listprivatelinkresources.go new file mode 100644 index 000000000000..088683b23a17 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listprivatelinkresources.go @@ -0,0 +1,89 @@ +package registries + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListPrivateLinkResourcesOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]PrivateLinkResource +} + +type ListPrivateLinkResourcesCompleteResult struct { + Items []PrivateLinkResource +} + +// ListPrivateLinkResources ... +func (c RegistriesClient) ListPrivateLinkResources(ctx context.Context, id RegistryId) (result ListPrivateLinkResourcesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/privateLinkResources", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]PrivateLinkResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListPrivateLinkResourcesComplete retrieves all the results into a single object +func (c RegistriesClient) ListPrivateLinkResourcesComplete(ctx context.Context, id RegistryId) (ListPrivateLinkResourcesCompleteResult, error) { + return c.ListPrivateLinkResourcesCompleteMatchingPredicate(ctx, id, PrivateLinkResourceOperationPredicate{}) +} + +// ListPrivateLinkResourcesCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c RegistriesClient) ListPrivateLinkResourcesCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate PrivateLinkResourceOperationPredicate) (result ListPrivateLinkResourcesCompleteResult, err error) { + items := make([]PrivateLinkResource, 0) + + resp, err := c.ListPrivateLinkResources(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListPrivateLinkResourcesCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listusages.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listusages.go new file mode 100644 index 000000000000..7c8cddeacb6b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listusages.go @@ -0,0 +1,52 @@ +package registries + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListUsagesOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *RegistryUsageListResult +} + +// ListUsages ... +func (c RegistriesClient) ListUsages(ctx context.Context, id RegistryId) (result ListUsagesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/listUsages", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_regeneratecredential.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_regeneratecredential.go new file mode 100644 index 000000000000..c45dbc8e3a9a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_regeneratecredential.go @@ -0,0 +1,56 @@ +package registries + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegenerateCredentialOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *RegistryListCredentialsResult +} + +// RegenerateCredential ... +func (c RegistriesClient) RegenerateCredential(ctx context.Context, id RegistryId, input RegenerateCredentialParameters) (result RegenerateCredentialOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/regenerateCredential", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_update.go new file mode 100644 index 000000000000..990dce091522 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_update.go @@ -0,0 +1,74 @@ +package registries + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Update ... +func (c RegistriesClient) Update(ctx context.Context, id RegistryId, input RegistryUpdateParameters) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c RegistriesClient) UpdateThenPoll(ctx context.Context, id RegistryId, input RegistryUpdateParameters) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_encryptionproperty.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_encryptionproperty.go new file mode 100644 index 000000000000..44af317bc4ef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_encryptionproperty.go @@ -0,0 +1,9 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EncryptionProperty struct { + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` + Status *EncryptionStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_exportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_exportpolicy.go new file mode 100644 index 000000000000..bcbc7e5b8e0c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_exportpolicy.go @@ -0,0 +1,8 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportPolicy struct { + Status *ExportPolicyStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsparameters.go new file mode 100644 index 000000000000..c06016d18bae --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsparameters.go @@ -0,0 +1,28 @@ +package registries + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GenerateCredentialsParameters struct { + Expiry *string `json:"expiry,omitempty"` + Name *TokenPasswordName `json:"name,omitempty"` + TokenId *string `json:"tokenId,omitempty"` +} + +func (o *GenerateCredentialsParameters) GetExpiryAsTime() (*time.Time, error) { + if o.Expiry == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Expiry, "2006-01-02T15:04:05Z07:00") +} + +func (o *GenerateCredentialsParameters) SetExpiryAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Expiry = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsresult.go new file mode 100644 index 000000000000..04e9f2ca4e13 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsresult.go @@ -0,0 +1,9 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GenerateCredentialsResult struct { + Passwords *[]TokenPassword `json:"passwords,omitempty"` + Username *string `json:"username,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importimageparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importimageparameters.go new file mode 100644 index 000000000000..87cf41482e0c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importimageparameters.go @@ -0,0 +1,11 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ImportImageParameters struct { + Mode *ImportMode `json:"mode,omitempty"` + Source ImportSource `json:"source"` + TargetTags *[]string `json:"targetTags,omitempty"` + UntaggedTargetRepositories *[]string `json:"untaggedTargetRepositories,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsource.go new file mode 100644 index 000000000000..31af23446452 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsource.go @@ -0,0 +1,11 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ImportSource struct { + Credentials *ImportSourceCredentials `json:"credentials,omitempty"` + RegistryUri *string `json:"registryUri,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SourceImage string `json:"sourceImage"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsourcecredentials.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsourcecredentials.go new file mode 100644 index 000000000000..58089b0fb0d9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsourcecredentials.go @@ -0,0 +1,9 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ImportSourceCredentials struct { + Password string `json:"password"` + Username *string `json:"username,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_iprule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_iprule.go new file mode 100644 index 000000000000..dd326aa73f3f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_iprule.go @@ -0,0 +1,9 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPRule struct { + Action *Action `json:"action,omitempty"` + Value string `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_keyvaultproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_keyvaultproperties.go new file mode 100644 index 000000000000..897c6dd8d9be --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_keyvaultproperties.go @@ -0,0 +1,30 @@ +package registries + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyVaultProperties struct { + Identity *string `json:"identity,omitempty"` + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + KeyRotationEnabled *bool `json:"keyRotationEnabled,omitempty"` + LastKeyRotationTimestamp *string `json:"lastKeyRotationTimestamp,omitempty"` + VersionedKeyIdentifier *string `json:"versionedKeyIdentifier,omitempty"` +} + +func (o *KeyVaultProperties) GetLastKeyRotationTimestampAsTime() (*time.Time, error) { + if o.LastKeyRotationTimestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastKeyRotationTimestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *KeyVaultProperties) SetLastKeyRotationTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastKeyRotationTimestamp = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_networkruleset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_networkruleset.go new file mode 100644 index 000000000000..dec8b58f5ced --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_networkruleset.go @@ -0,0 +1,9 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkRuleSet struct { + DefaultAction DefaultAction `json:"defaultAction"` + IPRules *[]IPRule `json:"ipRules,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_policies.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_policies.go new file mode 100644 index 000000000000..87ff2bbd4ba5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_policies.go @@ -0,0 +1,11 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Policies struct { + ExportPolicy *ExportPolicy `json:"exportPolicy,omitempty"` + QuarantinePolicy *QuarantinePolicy `json:"quarantinePolicy,omitempty"` + RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` + TrustPolicy *TrustPolicy `json:"trustPolicy,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpoint.go new file mode 100644 index 000000000000..411a1e09e74f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpoint.go @@ -0,0 +1,8 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpoint struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnection.go new file mode 100644 index 000000000000..788154720bc4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnection.go @@ -0,0 +1,16 @@ +package registries + +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 PrivateEndpointConnection struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnectionproperties.go new file mode 100644 index 000000000000..4c8ee66a8799 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnectionproperties.go @@ -0,0 +1,10 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnectionProperties struct { + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresource.go new file mode 100644 index 000000000000..bd76ad62e194 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresource.go @@ -0,0 +1,11 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkResource struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresourceproperties.go new file mode 100644 index 000000000000..bc9bc51fac79 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresourceproperties.go @@ -0,0 +1,10 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkResourceProperties struct { + GroupId *string `json:"groupId,omitempty"` + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkserviceconnectionstate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkserviceconnectionstate.go new file mode 100644 index 000000000000..574d08caf189 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkserviceconnectionstate.go @@ -0,0 +1,10 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkServiceConnectionState struct { + ActionsRequired *ActionsRequired `json:"actionsRequired,omitempty"` + Description *string `json:"description,omitempty"` + Status *ConnectionStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_quarantinepolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_quarantinepolicy.go new file mode 100644 index 000000000000..3d620232e941 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_quarantinepolicy.go @@ -0,0 +1,8 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QuarantinePolicy struct { + Status *PolicyStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_regeneratecredentialparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_regeneratecredentialparameters.go new file mode 100644 index 000000000000..755b01c4e9d2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_regeneratecredentialparameters.go @@ -0,0 +1,8 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegenerateCredentialParameters struct { + Name PasswordName `json:"name"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registry.go new file mode 100644 index 000000000000..5717ef0c63e9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registry.go @@ -0,0 +1,21 @@ +package registries + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/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 Registry struct { + Id *string `json:"id,omitempty"` + Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *RegistryProperties `json:"properties,omitempty"` + Sku Sku `json:"sku"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrylistcredentialsresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrylistcredentialsresult.go new file mode 100644 index 000000000000..73bbbf961384 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrylistcredentialsresult.go @@ -0,0 +1,9 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryListCredentialsResult struct { + Passwords *[]RegistryPassword `json:"passwords,omitempty"` + Username *string `json:"username,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypassword.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypassword.go new file mode 100644 index 000000000000..774a3c4a0808 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypassword.go @@ -0,0 +1,9 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryPassword struct { + Name *PasswordName `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryproperties.go new file mode 100644 index 000000000000..403f470fc4ff --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryproperties.go @@ -0,0 +1,39 @@ +package registries + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryProperties struct { + AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` + CreationDate *string `json:"creationDate,omitempty"` + DataEndpointEnabled *bool `json:"dataEndpointEnabled,omitempty"` + DataEndpointHostNames *[]string `json:"dataEndpointHostNames,omitempty"` + Encryption *EncryptionProperty `json:"encryption,omitempty"` + LoginServer *string `json:"loginServer,omitempty"` + NetworkRuleBypassOptions *NetworkRuleBypassOptions `json:"networkRuleBypassOptions,omitempty"` + NetworkRuleSet *NetworkRuleSet `json:"networkRuleSet,omitempty"` + Policies *Policies `json:"policies,omitempty"` + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + Status *Status `json:"status,omitempty"` + ZoneRedundancy *ZoneRedundancy `json:"zoneRedundancy,omitempty"` +} + +func (o *RegistryProperties) GetCreationDateAsTime() (*time.Time, error) { + if o.CreationDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *RegistryProperties) SetCreationDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationDate = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypropertiesupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypropertiesupdateparameters.go new file mode 100644 index 000000000000..f96e73ff91d1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypropertiesupdateparameters.go @@ -0,0 +1,14 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryPropertiesUpdateParameters struct { + AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` + DataEndpointEnabled *bool `json:"dataEndpointEnabled,omitempty"` + Encryption *EncryptionProperty `json:"encryption,omitempty"` + NetworkRuleBypassOptions *NetworkRuleBypassOptions `json:"networkRuleBypassOptions,omitempty"` + NetworkRuleSet *NetworkRuleSet `json:"networkRuleSet,omitempty"` + Policies *Policies `json:"policies,omitempty"` + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryupdateparameters.go new file mode 100644 index 000000000000..faaef3805a3b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryupdateparameters.go @@ -0,0 +1,15 @@ +package registries + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryUpdateParameters struct { + Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` + Properties *RegistryPropertiesUpdateParameters `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusage.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusage.go new file mode 100644 index 000000000000..360e66a853a7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusage.go @@ -0,0 +1,11 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryUsage struct { + CurrentValue *int64 `json:"currentValue,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Name *string `json:"name,omitempty"` + Unit *RegistryUsageUnit `json:"unit,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusagelistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusagelistresult.go new file mode 100644 index 000000000000..34f8adfe2395 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusagelistresult.go @@ -0,0 +1,8 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryUsageListResult struct { + Value *[]RegistryUsage `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_retentionpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_retentionpolicy.go new file mode 100644 index 000000000000..1db918f10410 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_retentionpolicy.go @@ -0,0 +1,28 @@ +package registries + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RetentionPolicy struct { + Days *int64 `json:"days,omitempty"` + LastUpdatedTime *string `json:"lastUpdatedTime,omitempty"` + Status *PolicyStatus `json:"status,omitempty"` +} + +func (o *RetentionPolicy) GetLastUpdatedTimeAsTime() (*time.Time, error) { + if o.LastUpdatedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *RetentionPolicy) SetLastUpdatedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_sku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_sku.go new file mode 100644 index 000000000000..2b0fae22fea6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_sku.go @@ -0,0 +1,9 @@ +package registries + +// 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 SkuName `json:"name"` + Tier *SkuTier `json:"tier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_status.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_status.go new file mode 100644 index 000000000000..2d04c2f49b43 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_status.go @@ -0,0 +1,28 @@ +package registries + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Status struct { + DisplayStatus *string `json:"displayStatus,omitempty"` + Message *string `json:"message,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *Status) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *Status) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_tokenpassword.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_tokenpassword.go new file mode 100644 index 000000000000..437fa0813f4c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_tokenpassword.go @@ -0,0 +1,41 @@ +package registries + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TokenPassword struct { + CreationTime *string `json:"creationTime,omitempty"` + Expiry *string `json:"expiry,omitempty"` + Name *TokenPasswordName `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +func (o *TokenPassword) GetCreationTimeAsTime() (*time.Time, error) { + if o.CreationTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *TokenPassword) SetCreationTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTime = &formatted +} + +func (o *TokenPassword) GetExpiryAsTime() (*time.Time, error) { + if o.Expiry == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Expiry, "2006-01-02T15:04:05Z07:00") +} + +func (o *TokenPassword) SetExpiryAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Expiry = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_trustpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_trustpolicy.go new file mode 100644 index 000000000000..33b15d9cc34f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_trustpolicy.go @@ -0,0 +1,9 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrustPolicy struct { + Status *PolicyStatus `json:"status,omitempty"` + Type *TrustPolicyType `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/predicates.go new file mode 100644 index 000000000000..2fd7c4122608 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/predicates.go @@ -0,0 +1,55 @@ +package registries + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkResourceOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p PrivateLinkResourceOperationPredicate) Matches(input PrivateLinkResource) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type RegistryOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p RegistryOperationPredicate) Matches(input Registry) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/version.go new file mode 100644 index 000000000000..4bb3fc9fbc7f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/version.go @@ -0,0 +1,12 @@ +package registries + +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 = "2023-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/registries/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 24c8b791d809..2b22ba17df33 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -379,6 +379,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01- github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/tokens github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/webhooks github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules +github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2019-08-01/containerservices github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-03-02-preview github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-03-02-preview/agentpools From f12244926ea98e42fd302393272b2774183f4ea2 Mon Sep 17 00:00:00 2001 From: Mateusz Haligowski Date: Sun, 26 Nov 2023 22:14:02 -0800 Subject: [PATCH 05/74] Fix the vendor versions --- internal/services/containers/client/client.go | 10 ++- .../container_registry_cache_rule.go | 62 ---------------- .../container_registry_cache_rule_test.go | 73 ------------------- vendor/modules.txt | 8 ++ 4 files changed, 17 insertions(+), 136 deletions(-) delete mode 100644 internal/services/containers/container_registry_cache_rule.go delete mode 100644 internal/services/containers/container_registry_cache_rule_test.go diff --git a/internal/services/containers/client/client.go b/internal/services/containers/client/client.go index 2637bb249fad..ee34f10823b5 100644 --- a/internal/services/containers/client/client.go +++ b/internal/services/containers/client/client.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2023-05-01/containerinstance" containerregistry_v2019_06_01_preview "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2019-06-01-preview" containerregistry_v2021_08_01_preview "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview" + containerregistry_v2023_07_01 "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01" "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2019-08-01/containerservices" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-09-02-preview/agentpools" @@ -26,8 +27,8 @@ import ( type Client struct { AgentPoolsClient *agentpools.AgentPoolsClient - CacheRulesClient *cacherules.CacheRulesClient ContainerInstanceClient *containerinstance.ContainerInstanceClient + ContainerRegistryClient_v2023_07_01 *containerregistry_v2023_07_01.Client ContainerRegistryClient_v2021_08_01_preview *containerregistry_v2021_08_01_preview.Client // v2019_06_01_preview is needed for container registry agent pools and tasks ContainerRegistryClient_v2019_06_01_preview *containerregistry_v2019_06_01_preview.Client @@ -63,6 +64,13 @@ func NewContainersClient(o *common.ClientOptions) (*Client, error) { return nil, err } + containerRegistryClient_v2023_07_01, err := containerregistry_v2023_07_01.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) { + o.Configure(c, o.Authorizers.ResourceManager) + }) + if err != nil { + return nil, err + } + // AKS fleetUpdateRunsClient, err := updateruns.NewUpdateRunsClientWithBaseURI(o.Environment.ResourceManager) if err != nil { diff --git a/internal/services/containers/container_registry_cache_rule.go b/internal/services/containers/container_registry_cache_rule.go deleted file mode 100644 index 6d77df8d1e0b..000000000000 --- a/internal/services/containers/container_registry_cache_rule.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package containers - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries" - containerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" -) - -func resourceContainerRegistryCacheRule() *pluginsdk.Resource { - return &pluginsdk.Resource{ - Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := registries.ParseRegistryID(id) - return err - }), - - Timeouts: &pluginsdk.ResourceTimeout{ - Create: pluginsdk.DefaultTimeout(30 * time.Minute), - Read: pluginsdk.DefaultTimeout(5 * time.Minute), - Update: pluginsdk.DefaultTimeout(30 * time.Minute), - Delete: pluginsdk.DefaultTimeout(30 * time.Minute), - }, - - Schema: resourceContainerRegistrySchema(), - } -} - -func resourceContainerRegistryCacheRuleSchema() map[string]*pluginsdk.Schema { - return map[string]*pluginsdk.Schema{ - "name": { - Type: pluginsdk.TypeString, - Required: true, - Description: "The name of the cache rule.", - }, - - "registry": { - Type: pluginsdk.TypeString, - Required: true, - Description: "The name of the container registry.", - ValidateFunc: containerValidate.ContainerRegistryName, - }, - - "source_repo": { - Type: pluginsdk.TypeString, - Required: true, - Description: "The full source repository path such as 'docker.io/library/ubuntu'.", - }, - - "target_repo": { - Type: pluginsdk.TypeString, - Required: true, - Description: "The target repository namespace such as 'ubuntu'.", - }, - - "resource_group_name": commonschema.ResourceGroupName(), - } -} diff --git a/internal/services/containers/container_registry_cache_rule_test.go b/internal/services/containers/container_registry_cache_rule_test.go deleted file mode 100644 index 1d386c2e22b2..000000000000 --- a/internal/services/containers/container_registry_cache_rule_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package containers_test - -import ( - "testing" - - "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" -) - -type ContainerRegistryCacheRule struct{} - -func TestAccContainerRegistryCacheRuleName_validation(t *testing.T) { - cases := []struct { - Value string - ErrCount int - }{ - { - Value: "", - ErrCount: 2, - }, - { - Value: "four", - ErrCount: 1, - }, - { - Value: "5five", - ErrCount: 0, - }, - { - Value: "hello-world", - ErrCount: 0, - }, - { - Value: "hello-world-foo-bar-12345", - ErrCount: 0, - }, - { - Value: "hello_world", - ErrCount: 1, - }, - { - Value: "helloWorld", - ErrCount: 0, - }, - { - Value: "helloworld12", - ErrCount: 0, - }, - { - Value: "hello@world", - ErrCount: 1, - }, - { - Value: "qfvbdsbvipqdbwsbddbdcwqffewsqwcdw21ddwqwd3324120", - ErrCount: 0, - }, - { - Value: "qfvbdsbvipqdbwsbddbdcwqffewsqwcdw21ddwqwd33241202", - ErrCount: 0, - }, - { - Value: "qfvbdsbvipqdbwsbddbdcwqfjjfewsqwcdw21ddwqwd3324120", - ErrCount: 1, - }, - } - - for _, tc := range cases { - _, errors := validate.ContainerRegistryCacheRuleName(tc.Value, "azurerm_container_registry_cache_rule") - - if len(errors) != tc.ErrCount { - t.Fatalf("Expected the Azure RM Container Registry Cache Rule Name to trigger a validation error: %v", errors) - } - } -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 2b22ba17df33..a104562891dd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -378,8 +378,16 @@ github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01- github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/scopemaps github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/tokens github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/webhooks +github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01 github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules +github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets +github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation +github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries +github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications +github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps +github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens +github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2019-08-01/containerservices github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-03-02-preview github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-03-02-preview/agentpools From 94412613c66a524bc08eae475d7e7a410624e14f Mon Sep 17 00:00:00 2001 From: Mateusz Haligowski Date: Sun, 26 Nov 2023 22:14:07 -0800 Subject: [PATCH 06/74] Fix the vendor versions --- .../container_registry_cache_rule_resource.go | 98 +++++++++ ...ainer_registry_cache_rule_resource_test.go | 73 +++++++ .../containerregistry/2023-07-01/client.go | 100 ++++++++++ .../2023-07-01/credentialsets/README.md | 99 ++++++++++ .../2023-07-01/credentialsets/client.go | 26 +++ .../2023-07-01/credentialsets/constants.go | 142 +++++++++++++ .../credentialsets/id_credentialset.go | 140 +++++++++++++ .../2023-07-01/credentialsets/id_registry.go | 127 ++++++++++++ .../credentialsets/method_create.go | 74 +++++++ .../credentialsets/method_delete.go | 70 +++++++ .../2023-07-01/credentialsets/method_get.go | 51 +++++ .../2023-07-01/credentialsets/method_list.go | 89 +++++++++ .../credentialsets/method_update.go | 74 +++++++ .../credentialsets/model_authcredential.go | 11 ++ .../credentialsets/model_credentialhealth.go | 10 + .../credentialsets/model_credentialset.go | 18 ++ .../model_credentialsetproperties.go | 29 +++ .../model_credentialsetupdateparameters.go | 13 ++ .../model_credentialsetupdateproperties.go | 8 + .../2023-07-01/credentialsets/predicates.go | 27 +++ .../2023-07-01/credentialsets/version.go | 12 ++ .../2023-07-01/operation/README.md | 41 ++++ .../2023-07-01/operation/client.go | 26 +++ .../2023-07-01/operation/constants.go | 48 +++++ .../method_registrieschecknameavailability.go | 57 ++++++ .../model_registrynamecheckrequest.go | 9 + .../operation/model_registrynamestatus.go | 10 + .../2023-07-01/operation/version.go | 12 ++ .../privateendpointconnections/README.md | 82 ++++++++ .../privateendpointconnections/client.go | 26 +++ .../privateendpointconnections/constants.go | 151 ++++++++++++++ .../id_privateendpointconnection.go | 140 +++++++++++++ .../privateendpointconnections/id_registry.go | 127 ++++++++++++ .../method_createorupdate.go | 74 +++++++ .../method_delete.go | 71 +++++++ .../privateendpointconnections/method_get.go | 51 +++++ .../privateendpointconnections/method_list.go | 89 +++++++++ .../model_privateendpoint.go | 8 + .../model_privateendpointconnection.go | 16 ++ ...del_privateendpointconnectionproperties.go | 10 + ...model_privatelinkserviceconnectionstate.go | 10 + .../privateendpointconnections/predicates.go | 27 +++ .../privateendpointconnections/version.go | 12 ++ .../2023-07-01/replications/README.md | 99 ++++++++++ .../2023-07-01/replications/client.go | 26 +++ .../2023-07-01/replications/constants.go | 104 ++++++++++ .../2023-07-01/replications/id_registry.go | 127 ++++++++++++ .../2023-07-01/replications/id_replication.go | 140 +++++++++++++ .../2023-07-01/replications/method_create.go | 74 +++++++ .../2023-07-01/replications/method_delete.go | 71 +++++++ .../2023-07-01/replications/method_get.go | 51 +++++ .../2023-07-01/replications/method_list.go | 89 +++++++++ .../2023-07-01/replications/method_update.go | 74 +++++++ .../replications/model_replication.go | 18 ++ .../model_replicationproperties.go | 11 ++ .../model_replicationupdateparameters.go | 9 + ...l_replicationupdateparametersproperties.go | 8 + .../2023-07-01/replications/model_status.go | 28 +++ .../2023-07-01/replications/predicates.go | 32 +++ .../2023-07-01/replications/version.go | 12 ++ .../2023-07-01/scopemaps/README.md | 99 ++++++++++ .../2023-07-01/scopemaps/client.go | 26 +++ .../2023-07-01/scopemaps/constants.go | 63 ++++++ .../2023-07-01/scopemaps/id_registry.go | 127 ++++++++++++ .../2023-07-01/scopemaps/id_scopemap.go | 140 +++++++++++++ .../2023-07-01/scopemaps/method_create.go | 74 +++++++ .../2023-07-01/scopemaps/method_delete.go | 71 +++++++ .../2023-07-01/scopemaps/method_get.go | 51 +++++ .../2023-07-01/scopemaps/method_list.go | 89 +++++++++ .../2023-07-01/scopemaps/method_update.go | 74 +++++++ .../2023-07-01/scopemaps/model_scopemap.go | 16 ++ .../scopemaps/model_scopemapproperties.go | 30 +++ ...odel_scopemappropertiesupdateparameters.go | 9 + .../model_scopemapupdateparameters.go | 8 + .../2023-07-01/scopemaps/predicates.go | 27 +++ .../2023-07-01/scopemaps/version.go | 12 ++ .../2023-07-01/tokens/README.md | 99 ++++++++++ .../2023-07-01/tokens/client.go | 26 +++ .../2023-07-01/tokens/constants.go | 186 ++++++++++++++++++ .../2023-07-01/tokens/id_registry.go | 127 ++++++++++++ .../2023-07-01/tokens/id_token.go | 140 +++++++++++++ .../2023-07-01/tokens/method_create.go | 74 +++++++ .../2023-07-01/tokens/method_delete.go | 71 +++++++ .../2023-07-01/tokens/method_get.go | 51 +++++ .../2023-07-01/tokens/method_list.go | 89 +++++++++ .../2023-07-01/tokens/method_update.go | 74 +++++++ .../2023-07-01/tokens/model_token.go | 16 ++ .../tokens/model_tokencertificate.go | 29 +++ .../model_tokencredentialsproperties.go | 9 + .../2023-07-01/tokens/model_tokenpassword.go | 41 ++++ .../tokens/model_tokenproperties.go | 30 +++ .../tokens/model_tokenupdateparameters.go | 8 + .../tokens/model_tokenupdateproperties.go | 10 + .../2023-07-01/tokens/predicates.go | 27 +++ .../2023-07-01/tokens/version.go | 12 ++ .../2023-07-01/webhooks/README.md | 148 ++++++++++++++ .../2023-07-01/webhooks/client.go | 26 +++ .../2023-07-01/webhooks/constants.go | 154 +++++++++++++++ .../2023-07-01/webhooks/id_registry.go | 127 ++++++++++++ .../2023-07-01/webhooks/id_webhook.go | 140 +++++++++++++ .../2023-07-01/webhooks/method_create.go | 74 +++++++ .../2023-07-01/webhooks/method_delete.go | 71 +++++++ .../2023-07-01/webhooks/method_get.go | 51 +++++ .../webhooks/method_getcallbackconfig.go | 52 +++++ .../2023-07-01/webhooks/method_list.go | 89 +++++++++ .../2023-07-01/webhooks/method_listevents.go | 89 +++++++++ .../2023-07-01/webhooks/method_ping.go | 52 +++++ .../2023-07-01/webhooks/method_update.go | 74 +++++++ .../2023-07-01/webhooks/model_actor.go | 8 + .../webhooks/model_callbackconfig.go | 9 + .../2023-07-01/webhooks/model_event.go | 10 + .../2023-07-01/webhooks/model_eventcontent.go | 32 +++ .../2023-07-01/webhooks/model_eventinfo.go | 8 + .../webhooks/model_eventrequestmessage.go | 12 ++ .../webhooks/model_eventresponsemessage.go | 12 ++ .../2023-07-01/webhooks/model_request.go | 12 ++ .../2023-07-01/webhooks/model_source.go | 9 + .../2023-07-01/webhooks/model_target.go | 16 ++ .../2023-07-01/webhooks/model_webhook.go | 18 ++ .../webhooks/model_webhookcreateparameters.go | 10 + .../webhooks/model_webhookproperties.go | 11 ++ ...model_webhookpropertiescreateparameters.go | 12 ++ ...model_webhookpropertiesupdateparameters.go | 12 ++ .../webhooks/model_webhookupdateparameters.go | 9 + .../2023-07-01/webhooks/predicates.go | 45 +++++ .../2023-07-01/webhooks/version.go | 12 ++ 126 files changed, 6800 insertions(+) create mode 100644 internal/services/containers/container_registry_cache_rule_resource.go create mode 100644 internal/services/containers/container_registry_cache_rule_resource_test.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_authcredential.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialhealth.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialset.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/method_registrieschecknameavailability.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamecheckrequest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamestatus.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_privateendpointconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_registry.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpoint.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnectionproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privatelinkserviceconnectionstate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_registry.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_replication.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_create.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replication.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparametersproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_status.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_registry.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_scopemap.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_create.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemap.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemappropertiesupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_registry.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_token.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_create.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_token.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencertificate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencredentialsproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenpassword.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_registry.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_create.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_getcallbackconfig.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_listevents.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_ping.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_actor.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_callbackconfig.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_event.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventcontent.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventinfo.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventrequestmessage.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventresponsemessage.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_request.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_source.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_target.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhook.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookcreateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiescreateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiesupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/version.go diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go new file mode 100644 index 000000000000..484d9ee95c7e --- /dev/null +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -0,0 +1,98 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package containers + +import ( + "fmt" + "log" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" + "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + containerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" +) + +func resourceContainerRegistryCacheRule() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { + _, err := cacherules.ParseCacheRuleID(id) + return err + }), + + Timeouts: &pluginsdk.ResourceTimeout{ + Create: pluginsdk.DefaultTimeout(30 * time.Minute), + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + Update: pluginsdk.DefaultTimeout(30 * time.Minute), + Delete: pluginsdk.DefaultTimeout(30 * time.Minute), + }, + + Schema: resourceContainerRegistrySchema(), + } +} + +func resourceContainerRegistryCacheRuleSchema() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + Description: "The name of the cache rule.", + }, + + "registry": { + Type: pluginsdk.TypeString, + Required: true, + Description: "The name of the container registry.", + ValidateFunc: containerValidate.ContainerRegistryName, + }, + + "source_repo": { + Type: pluginsdk.TypeString, + Required: true, + Description: "The full source repository path such as 'docker.io/library/ubuntu'.", + }, + + "target_repo": { + Type: pluginsdk.TypeString, + Required: true, + Description: "The target repository namespace such as 'ubuntu'.", + }, + + "resource_group_name": commonschema.ResourceGroupName(), + } +} + +func resourceContainerRegistryCacheRuleCreate(d *pluginsdk.ResourceData, meta interface{}) error { + cacheRulesClient := meta.(*clients.Client).Containers.ContainerRegistryClient_v2023_07_01.CacheRules + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + + ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) + + defer cancel() + log.Printf("[INFO] preparing arguments for Container Registry Cache Rule creation.") + + id := cacherules.NewCacheRuleID(subscriptionId, d.Get("resource_group_name").(string), d.Get("registry").(string), d.Get("name").(string)) + + if d.IsNewResource() { + existing, err := client.Get(ctx, id) + + if err != nil { + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for presence of existing %s: %s", id, err) + } + } + + if !response.WasNotFound(existing.HttpResponse) { + return tf.ImportAsExistsError("azurerm_container_registry_cache_rule", id.ID()) + } + + sId := commonids.NewSubscriptionID(subscriptionId) + + } +} diff --git a/internal/services/containers/container_registry_cache_rule_resource_test.go b/internal/services/containers/container_registry_cache_rule_resource_test.go new file mode 100644 index 000000000000..1d386c2e22b2 --- /dev/null +++ b/internal/services/containers/container_registry_cache_rule_resource_test.go @@ -0,0 +1,73 @@ +package containers_test + +import ( + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" +) + +type ContainerRegistryCacheRule struct{} + +func TestAccContainerRegistryCacheRuleName_validation(t *testing.T) { + cases := []struct { + Value string + ErrCount int + }{ + { + Value: "", + ErrCount: 2, + }, + { + Value: "four", + ErrCount: 1, + }, + { + Value: "5five", + ErrCount: 0, + }, + { + Value: "hello-world", + ErrCount: 0, + }, + { + Value: "hello-world-foo-bar-12345", + ErrCount: 0, + }, + { + Value: "hello_world", + ErrCount: 1, + }, + { + Value: "helloWorld", + ErrCount: 0, + }, + { + Value: "helloworld12", + ErrCount: 0, + }, + { + Value: "hello@world", + ErrCount: 1, + }, + { + Value: "qfvbdsbvipqdbwsbddbdcwqffewsqwcdw21ddwqwd3324120", + ErrCount: 0, + }, + { + Value: "qfvbdsbvipqdbwsbddbdcwqffewsqwcdw21ddwqwd33241202", + ErrCount: 0, + }, + { + Value: "qfvbdsbvipqdbwsbddbdcwqfjjfewsqwcdw21ddwqwd3324120", + ErrCount: 1, + }, + } + + for _, tc := range cases { + _, errors := validate.ContainerRegistryCacheRuleName(tc.Value, "azurerm_container_registry_cache_rule") + + if len(errors) != tc.ErrCount { + t.Fatalf("Expected the Azure RM Container Registry Cache Rule Name to trigger a validation error: %v", errors) + } + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/client.go new file mode 100644 index 000000000000..0b5041d944f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/client.go @@ -0,0 +1,100 @@ +package v2023_07_01 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +type Client struct { + CacheRules *cacherules.CacheRulesClient + CredentialSets *credentialsets.CredentialSetsClient + Operation *operation.OperationClient + PrivateEndpointConnections *privateendpointconnections.PrivateEndpointConnectionsClient + Registries *registries.RegistriesClient + Replications *replications.ReplicationsClient + ScopeMaps *scopemaps.ScopeMapsClient + Tokens *tokens.TokensClient + WebHooks *webhooks.WebHooksClient +} + +func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { + cacheRulesClient, err := cacherules.NewCacheRulesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building CacheRules client: %+v", err) + } + configureFunc(cacheRulesClient.Client) + + credentialSetsClient, err := credentialsets.NewCredentialSetsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building CredentialSets client: %+v", err) + } + configureFunc(credentialSetsClient.Client) + + operationClient, err := operation.NewOperationClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Operation client: %+v", err) + } + configureFunc(operationClient.Client) + + privateEndpointConnectionsClient, err := privateendpointconnections.NewPrivateEndpointConnectionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building PrivateEndpointConnections client: %+v", err) + } + configureFunc(privateEndpointConnectionsClient.Client) + + registriesClient, err := registries.NewRegistriesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Registries client: %+v", err) + } + configureFunc(registriesClient.Client) + + replicationsClient, err := replications.NewReplicationsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Replications client: %+v", err) + } + configureFunc(replicationsClient.Client) + + scopeMapsClient, err := scopemaps.NewScopeMapsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ScopeMaps client: %+v", err) + } + configureFunc(scopeMapsClient.Client) + + tokensClient, err := tokens.NewTokensClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Tokens client: %+v", err) + } + configureFunc(tokensClient.Client) + + webHooksClient, err := webhooks.NewWebHooksClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building WebHooks client: %+v", err) + } + configureFunc(webHooksClient.Client) + + return &Client{ + CacheRules: cacheRulesClient, + CredentialSets: credentialSetsClient, + Operation: operationClient, + PrivateEndpointConnections: privateEndpointConnectionsClient, + Registries: registriesClient, + Replications: replicationsClient, + ScopeMaps: scopeMapsClient, + Tokens: tokensClient, + WebHooks: webHooksClient, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/README.md new file mode 100644 index 000000000000..1928c694ff77 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/README.md @@ -0,0 +1,99 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets` Documentation + +The `credentialsets` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/credentialsets" +``` + + +### Client Initialization + +```go +client := credentialsets.NewCredentialSetsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `CredentialSetsClient.Create` + +```go +ctx := context.TODO() +id := credentialsets.NewCredentialSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "credentialSetValue") + +payload := credentialsets.CredentialSet{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CredentialSetsClient.Delete` + +```go +ctx := context.TODO() +id := credentialsets.NewCredentialSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "credentialSetValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CredentialSetsClient.Get` + +```go +ctx := context.TODO() +id := credentialsets.NewCredentialSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "credentialSetValue") + +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: `CredentialSetsClient.List` + +```go +ctx := context.TODO() +id := credentialsets.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `CredentialSetsClient.Update` + +```go +ctx := context.TODO() +id := credentialsets.NewCredentialSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "credentialSetValue") + +payload := credentialsets.CredentialSetUpdateParameters{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/client.go new file mode 100644 index 000000000000..cb20ca224462 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/client.go @@ -0,0 +1,26 @@ +package credentialsets + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialSetsClient struct { + Client *resourcemanager.Client +} + +func NewCredentialSetsClientWithBaseURI(sdkApi sdkEnv.Api) (*CredentialSetsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "credentialsets", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating CredentialSetsClient: %+v", err) + } + + return &CredentialSetsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/constants.go new file mode 100644 index 000000000000..ff71d8ceaa07 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/constants.go @@ -0,0 +1,142 @@ +package credentialsets + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialHealthStatus string + +const ( + CredentialHealthStatusHealthy CredentialHealthStatus = "Healthy" + CredentialHealthStatusUnhealthy CredentialHealthStatus = "Unhealthy" +) + +func PossibleValuesForCredentialHealthStatus() []string { + return []string{ + string(CredentialHealthStatusHealthy), + string(CredentialHealthStatusUnhealthy), + } +} + +func (s *CredentialHealthStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCredentialHealthStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCredentialHealthStatus(input string) (*CredentialHealthStatus, error) { + vals := map[string]CredentialHealthStatus{ + "healthy": CredentialHealthStatusHealthy, + "unhealthy": CredentialHealthStatusUnhealthy, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CredentialHealthStatus(input) + return &out, nil +} + +type CredentialName string + +const ( + CredentialNameCredentialOne CredentialName = "Credential1" +) + +func PossibleValuesForCredentialName() []string { + return []string{ + string(CredentialNameCredentialOne), + } +} + +func (s *CredentialName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCredentialName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCredentialName(input string) (*CredentialName, error) { + vals := map[string]CredentialName{ + "credential1": CredentialNameCredentialOne, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CredentialName(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go new file mode 100644 index 000000000000..4861a1140199 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go @@ -0,0 +1,140 @@ +package credentialsets + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = CredentialSetId{} + +// CredentialSetId is a struct representing the Resource ID for a Credential Set +type CredentialSetId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string + CredentialSetName string +} + +// NewCredentialSetID returns a new CredentialSetId struct +func NewCredentialSetID(subscriptionId string, resourceGroupName string, registryName string, credentialSetName string) CredentialSetId { + return CredentialSetId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + CredentialSetName: credentialSetName, + } +} + +// ParseCredentialSetID parses 'input' into a CredentialSetId +func ParseCredentialSetID(input string) (*CredentialSetId, error) { + parser := resourceids.NewParserFromResourceIdType(CredentialSetId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CredentialSetId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.CredentialSetName, ok = parsed.Parsed["credentialSetName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "credentialSetName", *parsed) + } + + return &id, nil +} + +// ParseCredentialSetIDInsensitively parses 'input' case-insensitively into a CredentialSetId +// note: this method should only be used for API response data and not user input +func ParseCredentialSetIDInsensitively(input string) (*CredentialSetId, error) { + parser := resourceids.NewParserFromResourceIdType(CredentialSetId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CredentialSetId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.CredentialSetName, ok = parsed.Parsed["credentialSetName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "credentialSetName", *parsed) + } + + return &id, nil +} + +// ValidateCredentialSetID checks that 'input' can be parsed as a Credential Set ID +func ValidateCredentialSetID(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 := ParseCredentialSetID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Credential Set ID +func (id CredentialSetId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/credentialSets/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.CredentialSetName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Credential Set ID +func (id CredentialSetId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + resourceids.StaticSegment("staticCredentialSets", "credentialSets", "credentialSets"), + resourceids.UserSpecifiedSegment("credentialSetName", "credentialSetValue"), + } +} + +// String returns a human-readable description of this Credential Set ID +func (id CredentialSetId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + fmt.Sprintf("Credential Set Name: %q", id.CredentialSetName), + } + return fmt.Sprintf("Credential Set (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go new file mode 100644 index 000000000000..a791778caf4d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go @@ -0,0 +1,127 @@ +package credentialsets + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = RegistryId{} + +// RegistryId is a struct representing the Resource ID for a Registry +type RegistryId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string +} + +// NewRegistryID returns a new RegistryId struct +func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { + return RegistryId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + } +} + +// ParseRegistryID parses 'input' into a RegistryId +func ParseRegistryID(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId +// note: this method should only be used for API response data and not user input +func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ValidateRegistryID checks that 'input' can be parsed as a Registry ID +func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Registry ID +func (id RegistryId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Registry ID +func (id RegistryId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + } +} + +// String returns a human-readable description of this Registry ID +func (id RegistryId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + } + return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go new file mode 100644 index 000000000000..61bdf6bc47aa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go @@ -0,0 +1,74 @@ +package credentialsets + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Create ... +func (c CredentialSetsClient) Create(ctx context.Context, id CredentialSetId, input CredentialSet) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c CredentialSetsClient) CreateThenPoll(ctx context.Context, id CredentialSetId, input CredentialSet) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_delete.go new file mode 100644 index 000000000000..ccf0140f8ef7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_delete.go @@ -0,0 +1,70 @@ +package credentialsets + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c CredentialSetsClient) Delete(ctx context.Context, id CredentialSetId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c CredentialSetsClient) DeleteThenPoll(ctx context.Context, id CredentialSetId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go new file mode 100644 index 000000000000..38e03ae42dd2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go @@ -0,0 +1,51 @@ +package credentialsets + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *CredentialSet +} + +// Get ... +func (c CredentialSetsClient) Get(ctx context.Context, id CredentialSetId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go new file mode 100644 index 000000000000..f3d5ed37de07 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go @@ -0,0 +1,89 @@ +package credentialsets + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]CredentialSet +} + +type ListCompleteResult struct { + Items []CredentialSet +} + +// List ... +func (c CredentialSetsClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/credentialSets", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]CredentialSet `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c CredentialSetsClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, CredentialSetOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c CredentialSetsClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate CredentialSetOperationPredicate) (result ListCompleteResult, err error) { + items := make([]CredentialSet, 0) + + resp, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go new file mode 100644 index 000000000000..d1aec5b11743 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go @@ -0,0 +1,74 @@ +package credentialsets + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Update ... +func (c CredentialSetsClient) Update(ctx context.Context, id CredentialSetId, input CredentialSetUpdateParameters) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c CredentialSetsClient) UpdateThenPoll(ctx context.Context, id CredentialSetId, input CredentialSetUpdateParameters) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_authcredential.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_authcredential.go new file mode 100644 index 000000000000..913c42662acb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_authcredential.go @@ -0,0 +1,11 @@ +package credentialsets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AuthCredential struct { + CredentialHealth *CredentialHealth `json:"credentialHealth,omitempty"` + Name *CredentialName `json:"name,omitempty"` + PasswordSecretIdentifier *string `json:"passwordSecretIdentifier,omitempty"` + UsernameSecretIdentifier *string `json:"usernameSecretIdentifier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialhealth.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialhealth.go new file mode 100644 index 000000000000..ca30e48d6f25 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialhealth.go @@ -0,0 +1,10 @@ +package credentialsets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialHealth struct { + ErrorCode *string `json:"errorCode,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + Status *CredentialHealthStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialset.go new file mode 100644 index 000000000000..26779ccad5c0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialset.go @@ -0,0 +1,18 @@ +package credentialsets + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/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 CredentialSet struct { + Id *string `json:"id,omitempty"` + Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` + Name *string `json:"name,omitempty"` + Properties *CredentialSetProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetproperties.go new file mode 100644 index 000000000000..12298beeb143 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetproperties.go @@ -0,0 +1,29 @@ +package credentialsets + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialSetProperties struct { + AuthCredentials *[]AuthCredential `json:"authCredentials,omitempty"` + CreationDate *string `json:"creationDate,omitempty"` + LoginServer *string `json:"loginServer,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} + +func (o *CredentialSetProperties) GetCreationDateAsTime() (*time.Time, error) { + if o.CreationDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *CredentialSetProperties) SetCreationDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationDate = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateparameters.go new file mode 100644 index 000000000000..b43c63ad176e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateparameters.go @@ -0,0 +1,13 @@ +package credentialsets + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialSetUpdateParameters struct { + Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` + Properties *CredentialSetUpdateProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateproperties.go new file mode 100644 index 000000000000..718731e5d24c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateproperties.go @@ -0,0 +1,8 @@ +package credentialsets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialSetUpdateProperties struct { + AuthCredentials *[]AuthCredential `json:"authCredentials,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/predicates.go new file mode 100644 index 000000000000..c8e61730e35a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/predicates.go @@ -0,0 +1,27 @@ +package credentialsets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialSetOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p CredentialSetOperationPredicate) Matches(input CredentialSet) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/version.go new file mode 100644 index 000000000000..51ea87a3966c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/version.go @@ -0,0 +1,12 @@ +package credentialsets + +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 = "2023-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/credentialsets/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/README.md new file mode 100644 index 000000000000..1dc6531b52b7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/README.md @@ -0,0 +1,41 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation` Documentation + +The `operation` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/operation" +``` + + +### Client Initialization + +```go +client := operation.NewOperationClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `OperationClient.RegistriesCheckNameAvailability` + +```go +ctx := context.TODO() +id := operation.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +payload := operation.RegistryNameCheckRequest{ + // ... +} + + +read, err := client.RegistriesCheckNameAvailability(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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/client.go new file mode 100644 index 000000000000..bac3e788aaf3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/client.go @@ -0,0 +1,26 @@ +package operation + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OperationClient struct { + Client *resourcemanager.Client +} + +func NewOperationClientWithBaseURI(sdkApi sdkEnv.Api) (*OperationClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "operation", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating OperationClient: %+v", err) + } + + return &OperationClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/constants.go new file mode 100644 index 000000000000..9582d637d757 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/constants.go @@ -0,0 +1,48 @@ +package operation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ContainerRegistryResourceType string + +const ( + ContainerRegistryResourceTypeMicrosoftPointContainerRegistryRegistries ContainerRegistryResourceType = "Microsoft.ContainerRegistry/registries" +) + +func PossibleValuesForContainerRegistryResourceType() []string { + return []string{ + string(ContainerRegistryResourceTypeMicrosoftPointContainerRegistryRegistries), + } +} + +func (s *ContainerRegistryResourceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseContainerRegistryResourceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseContainerRegistryResourceType(input string) (*ContainerRegistryResourceType, error) { + vals := map[string]ContainerRegistryResourceType{ + "microsoft.containerregistry/registries": ContainerRegistryResourceTypeMicrosoftPointContainerRegistryRegistries, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ContainerRegistryResourceType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/method_registrieschecknameavailability.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/method_registrieschecknameavailability.go new file mode 100644 index 000000000000..4a73c3622a06 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/method_registrieschecknameavailability.go @@ -0,0 +1,57 @@ +package operation + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistriesCheckNameAvailabilityOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *RegistryNameStatus +} + +// RegistriesCheckNameAvailability ... +func (c OperationClient) RegistriesCheckNameAvailability(ctx context.Context, id commonids.SubscriptionId, input RegistryNameCheckRequest) (result RegistriesCheckNameAvailabilityOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Microsoft.ContainerRegistry/checkNameAvailability", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamecheckrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamecheckrequest.go new file mode 100644 index 000000000000..1f540d0ab5e9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamecheckrequest.go @@ -0,0 +1,9 @@ +package operation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryNameCheckRequest struct { + Name string `json:"name"` + Type ContainerRegistryResourceType `json:"type"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamestatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamestatus.go new file mode 100644 index 000000000000..cd64ec3c5fe7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamestatus.go @@ -0,0 +1,10 @@ +package operation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryNameStatus struct { + Message *string `json:"message,omitempty"` + NameAvailable *bool `json:"nameAvailable,omitempty"` + Reason *string `json:"reason,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/version.go new file mode 100644 index 000000000000..1fb535b7cd2e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/version.go @@ -0,0 +1,12 @@ +package operation + +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 = "2023-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/operation/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/README.md new file mode 100644 index 000000000000..d2d94fd16c97 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections` Documentation + +The `privateendpointconnections` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/privateendpointconnections" +``` + + +### Client Initialization + +```go +client := privateendpointconnections.NewPrivateEndpointConnectionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `PrivateEndpointConnectionsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "privateEndpointConnectionValue") + +payload := privateendpointconnections.PrivateEndpointConnection{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `PrivateEndpointConnectionsClient.Delete` + +```go +ctx := context.TODO() +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "privateEndpointConnectionValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `PrivateEndpointConnectionsClient.Get` + +```go +ctx := context.TODO() +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "privateEndpointConnectionValue") + +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: `PrivateEndpointConnectionsClient.List` + +```go +ctx := context.TODO() +id := privateendpointconnections.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/client.go new file mode 100644 index 000000000000..3bf7a6afe1ff --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/client.go @@ -0,0 +1,26 @@ +package privateendpointconnections + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnectionsClient struct { + Client *resourcemanager.Client +} + +func NewPrivateEndpointConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*PrivateEndpointConnectionsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "privateendpointconnections", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating PrivateEndpointConnectionsClient: %+v", err) + } + + return &PrivateEndpointConnectionsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/constants.go new file mode 100644 index 000000000000..d1ec47a5f332 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/constants.go @@ -0,0 +1,151 @@ +package privateendpointconnections + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActionsRequired string + +const ( + ActionsRequiredNone ActionsRequired = "None" + ActionsRequiredRecreate ActionsRequired = "Recreate" +) + +func PossibleValuesForActionsRequired() []string { + return []string{ + string(ActionsRequiredNone), + string(ActionsRequiredRecreate), + } +} + +func (s *ActionsRequired) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseActionsRequired(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseActionsRequired(input string) (*ActionsRequired, error) { + vals := map[string]ActionsRequired{ + "none": ActionsRequiredNone, + "recreate": ActionsRequiredRecreate, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ActionsRequired(input) + return &out, nil +} + +type ConnectionStatus string + +const ( + ConnectionStatusApproved ConnectionStatus = "Approved" + ConnectionStatusDisconnected ConnectionStatus = "Disconnected" + ConnectionStatusPending ConnectionStatus = "Pending" + ConnectionStatusRejected ConnectionStatus = "Rejected" +) + +func PossibleValuesForConnectionStatus() []string { + return []string{ + string(ConnectionStatusApproved), + string(ConnectionStatusDisconnected), + string(ConnectionStatusPending), + string(ConnectionStatusRejected), + } +} + +func (s *ConnectionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseConnectionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseConnectionStatus(input string) (*ConnectionStatus, error) { + vals := map[string]ConnectionStatus{ + "approved": ConnectionStatusApproved, + "disconnected": ConnectionStatusDisconnected, + "pending": ConnectionStatusPending, + "rejected": ConnectionStatusRejected, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ConnectionStatus(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_privateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_privateendpointconnection.go new file mode 100644 index 000000000000..cfcb50d14bec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_privateendpointconnection.go @@ -0,0 +1,140 @@ +package privateendpointconnections + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = PrivateEndpointConnectionId{} + +// PrivateEndpointConnectionId is a struct representing the Resource ID for a Private Endpoint Connection +type PrivateEndpointConnectionId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string + PrivateEndpointConnectionName string +} + +// NewPrivateEndpointConnectionID returns a new PrivateEndpointConnectionId struct +func NewPrivateEndpointConnectionID(subscriptionId string, resourceGroupName string, registryName string, privateEndpointConnectionName string) PrivateEndpointConnectionId { + return PrivateEndpointConnectionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + PrivateEndpointConnectionName: privateEndpointConnectionName, + } +} + +// ParsePrivateEndpointConnectionID parses 'input' into a PrivateEndpointConnectionId +func ParsePrivateEndpointConnectionID(input string) (*PrivateEndpointConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(PrivateEndpointConnectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := PrivateEndpointConnectionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.PrivateEndpointConnectionName, ok = parsed.Parsed["privateEndpointConnectionName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointConnectionName", *parsed) + } + + return &id, nil +} + +// ParsePrivateEndpointConnectionIDInsensitively parses 'input' case-insensitively into a PrivateEndpointConnectionId +// note: this method should only be used for API response data and not user input +func ParsePrivateEndpointConnectionIDInsensitively(input string) (*PrivateEndpointConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(PrivateEndpointConnectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := PrivateEndpointConnectionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.PrivateEndpointConnectionName, ok = parsed.Parsed["privateEndpointConnectionName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointConnectionName", *parsed) + } + + return &id, nil +} + +// ValidatePrivateEndpointConnectionID checks that 'input' can be parsed as a Private Endpoint Connection ID +func ValidatePrivateEndpointConnectionID(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 := ParsePrivateEndpointConnectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Private Endpoint Connection ID +func (id PrivateEndpointConnectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/privateEndpointConnections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.PrivateEndpointConnectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Private Endpoint Connection ID +func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), + resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionValue"), + } +} + +// String returns a human-readable description of this Private Endpoint Connection ID +func (id PrivateEndpointConnectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + fmt.Sprintf("Private Endpoint Connection Name: %q", id.PrivateEndpointConnectionName), + } + return fmt.Sprintf("Private Endpoint Connection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_registry.go new file mode 100644 index 000000000000..1adc54deebd6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_registry.go @@ -0,0 +1,127 @@ +package privateendpointconnections + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = RegistryId{} + +// RegistryId is a struct representing the Resource ID for a Registry +type RegistryId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string +} + +// NewRegistryID returns a new RegistryId struct +func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { + return RegistryId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + } +} + +// ParseRegistryID parses 'input' into a RegistryId +func ParseRegistryID(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId +// note: this method should only be used for API response data and not user input +func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ValidateRegistryID checks that 'input' can be parsed as a Registry ID +func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Registry ID +func (id RegistryId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Registry ID +func (id RegistryId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + } +} + +// String returns a human-readable description of this Registry ID +func (id RegistryId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + } + return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_createorupdate.go new file mode 100644 index 000000000000..a0ef13382f23 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_createorupdate.go @@ -0,0 +1,74 @@ +package privateendpointconnections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// CreateOrUpdate ... +func (c PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, id PrivateEndpointConnectionId, input PrivateEndpointConnection) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c PrivateEndpointConnectionsClient) CreateOrUpdateThenPoll(ctx context.Context, id PrivateEndpointConnectionId, input PrivateEndpointConnection) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_delete.go new file mode 100644 index 000000000000..63c26e8f27f8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_delete.go @@ -0,0 +1,71 @@ +package privateendpointconnections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c PrivateEndpointConnectionsClient) Delete(ctx context.Context, id PrivateEndpointConnectionId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c PrivateEndpointConnectionsClient) DeleteThenPoll(ctx context.Context, id PrivateEndpointConnectionId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_get.go new file mode 100644 index 000000000000..6aeba2f77f92 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_get.go @@ -0,0 +1,51 @@ +package privateendpointconnections + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *PrivateEndpointConnection +} + +// Get ... +func (c PrivateEndpointConnectionsClient) Get(ctx context.Context, id PrivateEndpointConnectionId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_list.go new file mode 100644 index 000000000000..29dda338117a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_list.go @@ -0,0 +1,89 @@ +package privateendpointconnections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]PrivateEndpointConnection +} + +type ListCompleteResult struct { + Items []PrivateEndpointConnection +} + +// List ... +func (c PrivateEndpointConnectionsClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/privateEndpointConnections", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]PrivateEndpointConnection `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c PrivateEndpointConnectionsClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, PrivateEndpointConnectionOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c PrivateEndpointConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate PrivateEndpointConnectionOperationPredicate) (result ListCompleteResult, err error) { + items := make([]PrivateEndpointConnection, 0) + + resp, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpoint.go new file mode 100644 index 000000000000..1bc8cf2a97c3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpoint.go @@ -0,0 +1,8 @@ +package privateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpoint struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnection.go new file mode 100644 index 000000000000..977fe056fe33 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnection.go @@ -0,0 +1,16 @@ +package privateendpointconnections + +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 PrivateEndpointConnection struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnectionproperties.go new file mode 100644 index 000000000000..26d6b8a94640 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnectionproperties.go @@ -0,0 +1,10 @@ +package privateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnectionProperties struct { + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privatelinkserviceconnectionstate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privatelinkserviceconnectionstate.go new file mode 100644 index 000000000000..4501bc5a3f14 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privatelinkserviceconnectionstate.go @@ -0,0 +1,10 @@ +package privateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkServiceConnectionState struct { + ActionsRequired *ActionsRequired `json:"actionsRequired,omitempty"` + Description *string `json:"description,omitempty"` + Status *ConnectionStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/predicates.go new file mode 100644 index 000000000000..4a03a91ce52c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/predicates.go @@ -0,0 +1,27 @@ +package privateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnectionOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p PrivateEndpointConnectionOperationPredicate) Matches(input PrivateEndpointConnection) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/version.go new file mode 100644 index 000000000000..35cb9c96d6d1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/version.go @@ -0,0 +1,12 @@ +package privateendpointconnections + +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 = "2023-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/privateendpointconnections/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/README.md new file mode 100644 index 000000000000..a972471d00c8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/README.md @@ -0,0 +1,99 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications` Documentation + +The `replications` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/replications" +``` + + +### Client Initialization + +```go +client := replications.NewReplicationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ReplicationsClient.Create` + +```go +ctx := context.TODO() +id := replications.NewReplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "replicationValue") + +payload := replications.Replication{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ReplicationsClient.Delete` + +```go +ctx := context.TODO() +id := replications.NewReplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "replicationValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ReplicationsClient.Get` + +```go +ctx := context.TODO() +id := replications.NewReplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "replicationValue") + +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: `ReplicationsClient.List` + +```go +ctx := context.TODO() +id := replications.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ReplicationsClient.Update` + +```go +ctx := context.TODO() +id := replications.NewReplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "replicationValue") + +payload := replications.ReplicationUpdateParameters{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/client.go new file mode 100644 index 000000000000..4cd118374acb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/client.go @@ -0,0 +1,26 @@ +package replications + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationsClient struct { + Client *resourcemanager.Client +} + +func NewReplicationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ReplicationsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "replications", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ReplicationsClient: %+v", err) + } + + return &ReplicationsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/constants.go new file mode 100644 index 000000000000..6161484bd735 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/constants.go @@ -0,0 +1,104 @@ +package replications + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type ZoneRedundancy string + +const ( + ZoneRedundancyDisabled ZoneRedundancy = "Disabled" + ZoneRedundancyEnabled ZoneRedundancy = "Enabled" +) + +func PossibleValuesForZoneRedundancy() []string { + return []string{ + string(ZoneRedundancyDisabled), + string(ZoneRedundancyEnabled), + } +} + +func (s *ZoneRedundancy) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseZoneRedundancy(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseZoneRedundancy(input string) (*ZoneRedundancy, error) { + vals := map[string]ZoneRedundancy{ + "disabled": ZoneRedundancyDisabled, + "enabled": ZoneRedundancyEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ZoneRedundancy(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_registry.go new file mode 100644 index 000000000000..457ec9c52f5b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_registry.go @@ -0,0 +1,127 @@ +package replications + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = RegistryId{} + +// RegistryId is a struct representing the Resource ID for a Registry +type RegistryId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string +} + +// NewRegistryID returns a new RegistryId struct +func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { + return RegistryId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + } +} + +// ParseRegistryID parses 'input' into a RegistryId +func ParseRegistryID(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId +// note: this method should only be used for API response data and not user input +func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ValidateRegistryID checks that 'input' can be parsed as a Registry ID +func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Registry ID +func (id RegistryId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Registry ID +func (id RegistryId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + } +} + +// String returns a human-readable description of this Registry ID +func (id RegistryId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + } + return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_replication.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_replication.go new file mode 100644 index 000000000000..6402b1649eda --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_replication.go @@ -0,0 +1,140 @@ +package replications + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = ReplicationId{} + +// ReplicationId is a struct representing the Resource ID for a Replication +type ReplicationId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string + ReplicationName string +} + +// NewReplicationID returns a new ReplicationId struct +func NewReplicationID(subscriptionId string, resourceGroupName string, registryName string, replicationName string) ReplicationId { + return ReplicationId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + ReplicationName: replicationName, + } +} + +// ParseReplicationID parses 'input' into a ReplicationId +func ParseReplicationID(input string) (*ReplicationId, error) { + parser := resourceids.NewParserFromResourceIdType(ReplicationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ReplicationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.ReplicationName, ok = parsed.Parsed["replicationName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "replicationName", *parsed) + } + + return &id, nil +} + +// ParseReplicationIDInsensitively parses 'input' case-insensitively into a ReplicationId +// note: this method should only be used for API response data and not user input +func ParseReplicationIDInsensitively(input string) (*ReplicationId, error) { + parser := resourceids.NewParserFromResourceIdType(ReplicationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ReplicationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.ReplicationName, ok = parsed.Parsed["replicationName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "replicationName", *parsed) + } + + return &id, nil +} + +// ValidateReplicationID checks that 'input' can be parsed as a Replication ID +func ValidateReplicationID(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 := ParseReplicationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Replication ID +func (id ReplicationId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/replications/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.ReplicationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Replication ID +func (id ReplicationId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + resourceids.StaticSegment("staticReplications", "replications", "replications"), + resourceids.UserSpecifiedSegment("replicationName", "replicationValue"), + } +} + +// String returns a human-readable description of this Replication ID +func (id ReplicationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + fmt.Sprintf("Replication Name: %q", id.ReplicationName), + } + return fmt.Sprintf("Replication (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_create.go new file mode 100644 index 000000000000..579af9a99362 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_create.go @@ -0,0 +1,74 @@ +package replications + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Create ... +func (c ReplicationsClient) Create(ctx context.Context, id ReplicationId, input Replication) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c ReplicationsClient) CreateThenPoll(ctx context.Context, id ReplicationId, input Replication) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_delete.go new file mode 100644 index 000000000000..29cc8f8370a9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_delete.go @@ -0,0 +1,71 @@ +package replications + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c ReplicationsClient) Delete(ctx context.Context, id ReplicationId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c ReplicationsClient) DeleteThenPoll(ctx context.Context, id ReplicationId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_get.go new file mode 100644 index 000000000000..f76e9bbc07c0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_get.go @@ -0,0 +1,51 @@ +package replications + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Replication +} + +// Get ... +func (c ReplicationsClient) Get(ctx context.Context, id ReplicationId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_list.go new file mode 100644 index 000000000000..2dfadca7f8c0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_list.go @@ -0,0 +1,89 @@ +package replications + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Replication +} + +type ListCompleteResult struct { + Items []Replication +} + +// List ... +func (c ReplicationsClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/replications", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]Replication `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c ReplicationsClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, ReplicationOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ReplicationsClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate ReplicationOperationPredicate) (result ListCompleteResult, err error) { + items := make([]Replication, 0) + + resp, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_update.go new file mode 100644 index 000000000000..2ebad5b39c10 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_update.go @@ -0,0 +1,74 @@ +package replications + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Update ... +func (c ReplicationsClient) Update(ctx context.Context, id ReplicationId, input ReplicationUpdateParameters) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c ReplicationsClient) UpdateThenPoll(ctx context.Context, id ReplicationId, input ReplicationUpdateParameters) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replication.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replication.go new file mode 100644 index 000000000000..932be700cb9e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replication.go @@ -0,0 +1,18 @@ +package replications + +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 Replication struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *ReplicationProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationproperties.go new file mode 100644 index 000000000000..3f63c28dc2b9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationproperties.go @@ -0,0 +1,11 @@ +package replications + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationProperties struct { + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + RegionEndpointEnabled *bool `json:"regionEndpointEnabled,omitempty"` + Status *Status `json:"status,omitempty"` + ZoneRedundancy *ZoneRedundancy `json:"zoneRedundancy,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparameters.go new file mode 100644 index 000000000000..828a1fbc4ab2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparameters.go @@ -0,0 +1,9 @@ +package replications + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationUpdateParameters struct { + Properties *ReplicationUpdateParametersProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparametersproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparametersproperties.go new file mode 100644 index 000000000000..856e3b415ffc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparametersproperties.go @@ -0,0 +1,8 @@ +package replications + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationUpdateParametersProperties struct { + RegionEndpointEnabled *bool `json:"regionEndpointEnabled,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_status.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_status.go new file mode 100644 index 000000000000..0e6acd8d6afb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_status.go @@ -0,0 +1,28 @@ +package replications + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Status struct { + DisplayStatus *string `json:"displayStatus,omitempty"` + Message *string `json:"message,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *Status) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *Status) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/predicates.go new file mode 100644 index 000000000000..fbba0b6c312e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/predicates.go @@ -0,0 +1,32 @@ +package replications + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p ReplicationOperationPredicate) Matches(input Replication) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/version.go new file mode 100644 index 000000000000..9d09e1d982cc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/version.go @@ -0,0 +1,12 @@ +package replications + +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 = "2023-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/replications/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/README.md new file mode 100644 index 000000000000..d5bb9fb12136 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/README.md @@ -0,0 +1,99 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps` Documentation + +The `scopemaps` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/scopemaps" +``` + + +### Client Initialization + +```go +client := scopemaps.NewScopeMapsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ScopeMapsClient.Create` + +```go +ctx := context.TODO() +id := scopemaps.NewScopeMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "scopeMapValue") + +payload := scopemaps.ScopeMap{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ScopeMapsClient.Delete` + +```go +ctx := context.TODO() +id := scopemaps.NewScopeMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "scopeMapValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ScopeMapsClient.Get` + +```go +ctx := context.TODO() +id := scopemaps.NewScopeMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "scopeMapValue") + +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: `ScopeMapsClient.List` + +```go +ctx := context.TODO() +id := scopemaps.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ScopeMapsClient.Update` + +```go +ctx := context.TODO() +id := scopemaps.NewScopeMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "scopeMapValue") + +payload := scopemaps.ScopeMapUpdateParameters{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/client.go new file mode 100644 index 000000000000..a5ac7bcecec3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/client.go @@ -0,0 +1,26 @@ +package scopemaps + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScopeMapsClient struct { + Client *resourcemanager.Client +} + +func NewScopeMapsClientWithBaseURI(sdkApi sdkEnv.Api) (*ScopeMapsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "scopemaps", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ScopeMapsClient: %+v", err) + } + + return &ScopeMapsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/constants.go new file mode 100644 index 000000000000..a3cdf65bba18 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/constants.go @@ -0,0 +1,63 @@ +package scopemaps + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_registry.go new file mode 100644 index 000000000000..1967fbf250a4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_registry.go @@ -0,0 +1,127 @@ +package scopemaps + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = RegistryId{} + +// RegistryId is a struct representing the Resource ID for a Registry +type RegistryId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string +} + +// NewRegistryID returns a new RegistryId struct +func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { + return RegistryId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + } +} + +// ParseRegistryID parses 'input' into a RegistryId +func ParseRegistryID(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId +// note: this method should only be used for API response data and not user input +func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ValidateRegistryID checks that 'input' can be parsed as a Registry ID +func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Registry ID +func (id RegistryId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Registry ID +func (id RegistryId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + } +} + +// String returns a human-readable description of this Registry ID +func (id RegistryId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + } + return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_scopemap.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_scopemap.go new file mode 100644 index 000000000000..1286cbbb29e9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_scopemap.go @@ -0,0 +1,140 @@ +package scopemaps + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = ScopeMapId{} + +// ScopeMapId is a struct representing the Resource ID for a Scope Map +type ScopeMapId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string + ScopeMapName string +} + +// NewScopeMapID returns a new ScopeMapId struct +func NewScopeMapID(subscriptionId string, resourceGroupName string, registryName string, scopeMapName string) ScopeMapId { + return ScopeMapId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + ScopeMapName: scopeMapName, + } +} + +// ParseScopeMapID parses 'input' into a ScopeMapId +func ParseScopeMapID(input string) (*ScopeMapId, error) { + parser := resourceids.NewParserFromResourceIdType(ScopeMapId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ScopeMapId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.ScopeMapName, ok = parsed.Parsed["scopeMapName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "scopeMapName", *parsed) + } + + return &id, nil +} + +// ParseScopeMapIDInsensitively parses 'input' case-insensitively into a ScopeMapId +// note: this method should only be used for API response data and not user input +func ParseScopeMapIDInsensitively(input string) (*ScopeMapId, error) { + parser := resourceids.NewParserFromResourceIdType(ScopeMapId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ScopeMapId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.ScopeMapName, ok = parsed.Parsed["scopeMapName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "scopeMapName", *parsed) + } + + return &id, nil +} + +// ValidateScopeMapID checks that 'input' can be parsed as a Scope Map ID +func ValidateScopeMapID(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 := ParseScopeMapID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Scope Map ID +func (id ScopeMapId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/scopeMaps/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.ScopeMapName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Scope Map ID +func (id ScopeMapId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + resourceids.StaticSegment("staticScopeMaps", "scopeMaps", "scopeMaps"), + resourceids.UserSpecifiedSegment("scopeMapName", "scopeMapValue"), + } +} + +// String returns a human-readable description of this Scope Map ID +func (id ScopeMapId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + fmt.Sprintf("Scope Map Name: %q", id.ScopeMapName), + } + return fmt.Sprintf("Scope Map (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_create.go new file mode 100644 index 000000000000..815ad068f82d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_create.go @@ -0,0 +1,74 @@ +package scopemaps + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Create ... +func (c ScopeMapsClient) Create(ctx context.Context, id ScopeMapId, input ScopeMap) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c ScopeMapsClient) CreateThenPoll(ctx context.Context, id ScopeMapId, input ScopeMap) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_delete.go new file mode 100644 index 000000000000..6a6cd2fa49b2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_delete.go @@ -0,0 +1,71 @@ +package scopemaps + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c ScopeMapsClient) Delete(ctx context.Context, id ScopeMapId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c ScopeMapsClient) DeleteThenPoll(ctx context.Context, id ScopeMapId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_get.go new file mode 100644 index 000000000000..6d4fcb00cb3a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_get.go @@ -0,0 +1,51 @@ +package scopemaps + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ScopeMap +} + +// Get ... +func (c ScopeMapsClient) Get(ctx context.Context, id ScopeMapId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_list.go new file mode 100644 index 000000000000..9dc878a8646d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_list.go @@ -0,0 +1,89 @@ +package scopemaps + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ScopeMap +} + +type ListCompleteResult struct { + Items []ScopeMap +} + +// List ... +func (c ScopeMapsClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/scopeMaps", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]ScopeMap `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c ScopeMapsClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, ScopeMapOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ScopeMapsClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate ScopeMapOperationPredicate) (result ListCompleteResult, err error) { + items := make([]ScopeMap, 0) + + resp, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_update.go new file mode 100644 index 000000000000..4afaa88af831 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_update.go @@ -0,0 +1,74 @@ +package scopemaps + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Update ... +func (c ScopeMapsClient) Update(ctx context.Context, id ScopeMapId, input ScopeMapUpdateParameters) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c ScopeMapsClient) UpdateThenPoll(ctx context.Context, id ScopeMapId, input ScopeMapUpdateParameters) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemap.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemap.go new file mode 100644 index 000000000000..844e87fc8140 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemap.go @@ -0,0 +1,16 @@ +package scopemaps + +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 ScopeMap struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ScopeMapProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapproperties.go new file mode 100644 index 000000000000..52d2be4afcf5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapproperties.go @@ -0,0 +1,30 @@ +package scopemaps + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScopeMapProperties struct { + Actions []string `json:"actions"` + CreationDate *string `json:"creationDate,omitempty"` + Description *string `json:"description,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (o *ScopeMapProperties) GetCreationDateAsTime() (*time.Time, error) { + if o.CreationDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *ScopeMapProperties) SetCreationDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationDate = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemappropertiesupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemappropertiesupdateparameters.go new file mode 100644 index 000000000000..fb7304188c92 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemappropertiesupdateparameters.go @@ -0,0 +1,9 @@ +package scopemaps + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScopeMapPropertiesUpdateParameters struct { + Actions *[]string `json:"actions,omitempty"` + Description *string `json:"description,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapupdateparameters.go new file mode 100644 index 000000000000..d735edef15dc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapupdateparameters.go @@ -0,0 +1,8 @@ +package scopemaps + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScopeMapUpdateParameters struct { + Properties *ScopeMapPropertiesUpdateParameters `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/predicates.go new file mode 100644 index 000000000000..7ea335c428ca --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/predicates.go @@ -0,0 +1,27 @@ +package scopemaps + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScopeMapOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p ScopeMapOperationPredicate) Matches(input ScopeMap) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/version.go new file mode 100644 index 000000000000..567a42d9286d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/version.go @@ -0,0 +1,12 @@ +package scopemaps + +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 = "2023-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/scopemaps/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/README.md new file mode 100644 index 000000000000..35c41d68b72a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/README.md @@ -0,0 +1,99 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens` Documentation + +The `tokens` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/tokens" +``` + + +### Client Initialization + +```go +client := tokens.NewTokensClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `TokensClient.Create` + +```go +ctx := context.TODO() +id := tokens.NewTokenID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "tokenValue") + +payload := tokens.Token{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `TokensClient.Delete` + +```go +ctx := context.TODO() +id := tokens.NewTokenID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "tokenValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `TokensClient.Get` + +```go +ctx := context.TODO() +id := tokens.NewTokenID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "tokenValue") + +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: `TokensClient.List` + +```go +ctx := context.TODO() +id := tokens.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `TokensClient.Update` + +```go +ctx := context.TODO() +id := tokens.NewTokenID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "tokenValue") + +payload := tokens.TokenUpdateParameters{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/client.go new file mode 100644 index 000000000000..11f08be868cb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/client.go @@ -0,0 +1,26 @@ +package tokens + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TokensClient struct { + Client *resourcemanager.Client +} + +func NewTokensClientWithBaseURI(sdkApi sdkEnv.Api) (*TokensClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "tokens", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating TokensClient: %+v", err) + } + + return &TokensClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/constants.go new file mode 100644 index 000000000000..85997819ca3f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/constants.go @@ -0,0 +1,186 @@ +package tokens + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type TokenCertificateName string + +const ( + TokenCertificateNameCertificateOne TokenCertificateName = "certificate1" + TokenCertificateNameCertificateTwo TokenCertificateName = "certificate2" +) + +func PossibleValuesForTokenCertificateName() []string { + return []string{ + string(TokenCertificateNameCertificateOne), + string(TokenCertificateNameCertificateTwo), + } +} + +func (s *TokenCertificateName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTokenCertificateName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTokenCertificateName(input string) (*TokenCertificateName, error) { + vals := map[string]TokenCertificateName{ + "certificate1": TokenCertificateNameCertificateOne, + "certificate2": TokenCertificateNameCertificateTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TokenCertificateName(input) + return &out, nil +} + +type TokenPasswordName string + +const ( + TokenPasswordNamePasswordOne TokenPasswordName = "password1" + TokenPasswordNamePasswordTwo TokenPasswordName = "password2" +) + +func PossibleValuesForTokenPasswordName() []string { + return []string{ + string(TokenPasswordNamePasswordOne), + string(TokenPasswordNamePasswordTwo), + } +} + +func (s *TokenPasswordName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTokenPasswordName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTokenPasswordName(input string) (*TokenPasswordName, error) { + vals := map[string]TokenPasswordName{ + "password1": TokenPasswordNamePasswordOne, + "password2": TokenPasswordNamePasswordTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TokenPasswordName(input) + return &out, nil +} + +type TokenStatus string + +const ( + TokenStatusDisabled TokenStatus = "disabled" + TokenStatusEnabled TokenStatus = "enabled" +) + +func PossibleValuesForTokenStatus() []string { + return []string{ + string(TokenStatusDisabled), + string(TokenStatusEnabled), + } +} + +func (s *TokenStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTokenStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTokenStatus(input string) (*TokenStatus, error) { + vals := map[string]TokenStatus{ + "disabled": TokenStatusDisabled, + "enabled": TokenStatusEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TokenStatus(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_registry.go new file mode 100644 index 000000000000..4c7ee22e373c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_registry.go @@ -0,0 +1,127 @@ +package tokens + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = RegistryId{} + +// RegistryId is a struct representing the Resource ID for a Registry +type RegistryId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string +} + +// NewRegistryID returns a new RegistryId struct +func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { + return RegistryId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + } +} + +// ParseRegistryID parses 'input' into a RegistryId +func ParseRegistryID(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId +// note: this method should only be used for API response data and not user input +func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ValidateRegistryID checks that 'input' can be parsed as a Registry ID +func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Registry ID +func (id RegistryId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Registry ID +func (id RegistryId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + } +} + +// String returns a human-readable description of this Registry ID +func (id RegistryId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + } + return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_token.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_token.go new file mode 100644 index 000000000000..6d8c7149e6c8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_token.go @@ -0,0 +1,140 @@ +package tokens + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = TokenId{} + +// TokenId is a struct representing the Resource ID for a Token +type TokenId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string + TokenName string +} + +// NewTokenID returns a new TokenId struct +func NewTokenID(subscriptionId string, resourceGroupName string, registryName string, tokenName string) TokenId { + return TokenId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + TokenName: tokenName, + } +} + +// ParseTokenID parses 'input' into a TokenId +func ParseTokenID(input string) (*TokenId, error) { + parser := resourceids.NewParserFromResourceIdType(TokenId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := TokenId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.TokenName, ok = parsed.Parsed["tokenName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "tokenName", *parsed) + } + + return &id, nil +} + +// ParseTokenIDInsensitively parses 'input' case-insensitively into a TokenId +// note: this method should only be used for API response data and not user input +func ParseTokenIDInsensitively(input string) (*TokenId, error) { + parser := resourceids.NewParserFromResourceIdType(TokenId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := TokenId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.TokenName, ok = parsed.Parsed["tokenName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "tokenName", *parsed) + } + + return &id, nil +} + +// ValidateTokenID checks that 'input' can be parsed as a Token ID +func ValidateTokenID(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 := ParseTokenID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Token ID +func (id TokenId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/tokens/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.TokenName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Token ID +func (id TokenId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + resourceids.StaticSegment("staticTokens", "tokens", "tokens"), + resourceids.UserSpecifiedSegment("tokenName", "tokenValue"), + } +} + +// String returns a human-readable description of this Token ID +func (id TokenId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + fmt.Sprintf("Token Name: %q", id.TokenName), + } + return fmt.Sprintf("Token (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_create.go new file mode 100644 index 000000000000..53aa1338a631 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_create.go @@ -0,0 +1,74 @@ +package tokens + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Create ... +func (c TokensClient) Create(ctx context.Context, id TokenId, input Token) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c TokensClient) CreateThenPoll(ctx context.Context, id TokenId, input Token) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_delete.go new file mode 100644 index 000000000000..7ed822bf15b4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_delete.go @@ -0,0 +1,71 @@ +package tokens + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c TokensClient) Delete(ctx context.Context, id TokenId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c TokensClient) DeleteThenPoll(ctx context.Context, id TokenId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_get.go new file mode 100644 index 000000000000..59133098fccb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_get.go @@ -0,0 +1,51 @@ +package tokens + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Token +} + +// Get ... +func (c TokensClient) Get(ctx context.Context, id TokenId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_list.go new file mode 100644 index 000000000000..79b326ea831f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_list.go @@ -0,0 +1,89 @@ +package tokens + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Token +} + +type ListCompleteResult struct { + Items []Token +} + +// List ... +func (c TokensClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/tokens", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]Token `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c TokensClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, TokenOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c TokensClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate TokenOperationPredicate) (result ListCompleteResult, err error) { + items := make([]Token, 0) + + resp, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_update.go new file mode 100644 index 000000000000..44be7e22ae12 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_update.go @@ -0,0 +1,74 @@ +package tokens + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Update ... +func (c TokensClient) Update(ctx context.Context, id TokenId, input TokenUpdateParameters) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c TokensClient) UpdateThenPoll(ctx context.Context, id TokenId, input TokenUpdateParameters) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_token.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_token.go new file mode 100644 index 000000000000..c459084be8ed --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_token.go @@ -0,0 +1,16 @@ +package tokens + +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 Token struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *TokenProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencertificate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencertificate.go new file mode 100644 index 000000000000..8e4a5d3cde7a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencertificate.go @@ -0,0 +1,29 @@ +package tokens + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TokenCertificate struct { + EncodedPemCertificate *string `json:"encodedPemCertificate,omitempty"` + Expiry *string `json:"expiry,omitempty"` + Name *TokenCertificateName `json:"name,omitempty"` + Thumbprint *string `json:"thumbprint,omitempty"` +} + +func (o *TokenCertificate) GetExpiryAsTime() (*time.Time, error) { + if o.Expiry == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Expiry, "2006-01-02T15:04:05Z07:00") +} + +func (o *TokenCertificate) SetExpiryAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Expiry = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencredentialsproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencredentialsproperties.go new file mode 100644 index 000000000000..de0203f7e63e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencredentialsproperties.go @@ -0,0 +1,9 @@ +package tokens + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TokenCredentialsProperties struct { + Certificates *[]TokenCertificate `json:"certificates,omitempty"` + Passwords *[]TokenPassword `json:"passwords,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenpassword.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenpassword.go new file mode 100644 index 000000000000..f46a71eab86c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenpassword.go @@ -0,0 +1,41 @@ +package tokens + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TokenPassword struct { + CreationTime *string `json:"creationTime,omitempty"` + Expiry *string `json:"expiry,omitempty"` + Name *TokenPasswordName `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +func (o *TokenPassword) GetCreationTimeAsTime() (*time.Time, error) { + if o.CreationTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *TokenPassword) SetCreationTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTime = &formatted +} + +func (o *TokenPassword) GetExpiryAsTime() (*time.Time, error) { + if o.Expiry == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Expiry, "2006-01-02T15:04:05Z07:00") +} + +func (o *TokenPassword) SetExpiryAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Expiry = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenproperties.go new file mode 100644 index 000000000000..a2f60da2fa52 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenproperties.go @@ -0,0 +1,30 @@ +package tokens + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TokenProperties struct { + CreationDate *string `json:"creationDate,omitempty"` + Credentials *TokenCredentialsProperties `json:"credentials,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ScopeMapId *string `json:"scopeMapId,omitempty"` + Status *TokenStatus `json:"status,omitempty"` +} + +func (o *TokenProperties) GetCreationDateAsTime() (*time.Time, error) { + if o.CreationDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *TokenProperties) SetCreationDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationDate = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateparameters.go new file mode 100644 index 000000000000..3a13b6690786 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateparameters.go @@ -0,0 +1,8 @@ +package tokens + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TokenUpdateParameters struct { + Properties *TokenUpdateProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateproperties.go new file mode 100644 index 000000000000..c02a611e1cd5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateproperties.go @@ -0,0 +1,10 @@ +package tokens + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TokenUpdateProperties struct { + Credentials *TokenCredentialsProperties `json:"credentials,omitempty"` + ScopeMapId *string `json:"scopeMapId,omitempty"` + Status *TokenStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/predicates.go new file mode 100644 index 000000000000..e76d969798d3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/predicates.go @@ -0,0 +1,27 @@ +package tokens + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TokenOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p TokenOperationPredicate) Matches(input Token) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/version.go new file mode 100644 index 000000000000..9b11230b9b84 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/version.go @@ -0,0 +1,12 @@ +package tokens + +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 = "2023-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/tokens/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/README.md new file mode 100644 index 000000000000..201c6990d07b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/README.md @@ -0,0 +1,148 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks` Documentation + +The `webhooks` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/webhooks" +``` + + +### Client Initialization + +```go +client := webhooks.NewWebHooksClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `WebHooksClient.Create` + +```go +ctx := context.TODO() +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue") + +payload := webhooks.WebhookCreateParameters{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `WebHooksClient.Delete` + +```go +ctx := context.TODO() +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `WebHooksClient.Get` + +```go +ctx := context.TODO() +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue") + +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: `WebHooksClient.GetCallbackConfig` + +```go +ctx := context.TODO() +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue") + +read, err := client.GetCallbackConfig(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WebHooksClient.List` + +```go +ctx := context.TODO() +id := webhooks.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `WebHooksClient.ListEvents` + +```go +ctx := context.TODO() +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue") + +// alternatively `client.ListEvents(ctx, id)` can be used to do batched pagination +items, err := client.ListEventsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `WebHooksClient.Ping` + +```go +ctx := context.TODO() +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue") + +read, err := client.Ping(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WebHooksClient.Update` + +```go +ctx := context.TODO() +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue") + +payload := webhooks.WebhookUpdateParameters{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/client.go new file mode 100644 index 000000000000..b5da8564ffd9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/client.go @@ -0,0 +1,26 @@ +package webhooks + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WebHooksClient struct { + Client *resourcemanager.Client +} + +func NewWebHooksClientWithBaseURI(sdkApi sdkEnv.Api) (*WebHooksClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "webhooks", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating WebHooksClient: %+v", err) + } + + return &WebHooksClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/constants.go new file mode 100644 index 000000000000..8da25bd4a152 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/constants.go @@ -0,0 +1,154 @@ +package webhooks + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type WebhookAction string + +const ( + WebhookActionChartDelete WebhookAction = "chart_delete" + WebhookActionChartPush WebhookAction = "chart_push" + WebhookActionDelete WebhookAction = "delete" + WebhookActionPush WebhookAction = "push" + WebhookActionQuarantine WebhookAction = "quarantine" +) + +func PossibleValuesForWebhookAction() []string { + return []string{ + string(WebhookActionChartDelete), + string(WebhookActionChartPush), + string(WebhookActionDelete), + string(WebhookActionPush), + string(WebhookActionQuarantine), + } +} + +func (s *WebhookAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWebhookAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWebhookAction(input string) (*WebhookAction, error) { + vals := map[string]WebhookAction{ + "chart_delete": WebhookActionChartDelete, + "chart_push": WebhookActionChartPush, + "delete": WebhookActionDelete, + "push": WebhookActionPush, + "quarantine": WebhookActionQuarantine, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WebhookAction(input) + return &out, nil +} + +type WebhookStatus string + +const ( + WebhookStatusDisabled WebhookStatus = "disabled" + WebhookStatusEnabled WebhookStatus = "enabled" +) + +func PossibleValuesForWebhookStatus() []string { + return []string{ + string(WebhookStatusDisabled), + string(WebhookStatusEnabled), + } +} + +func (s *WebhookStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWebhookStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWebhookStatus(input string) (*WebhookStatus, error) { + vals := map[string]WebhookStatus{ + "disabled": WebhookStatusDisabled, + "enabled": WebhookStatusEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WebhookStatus(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_registry.go new file mode 100644 index 000000000000..6a0695fe81df --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_registry.go @@ -0,0 +1,127 @@ +package webhooks + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = RegistryId{} + +// RegistryId is a struct representing the Resource ID for a Registry +type RegistryId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string +} + +// NewRegistryID returns a new RegistryId struct +func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { + return RegistryId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + } +} + +// ParseRegistryID parses 'input' into a RegistryId +func ParseRegistryID(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId +// note: this method should only be used for API response data and not user input +func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RegistryId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + return &id, nil +} + +// ValidateRegistryID checks that 'input' can be parsed as a Registry ID +func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Registry ID +func (id RegistryId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Registry ID +func (id RegistryId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + } +} + +// String returns a human-readable description of this Registry ID +func (id RegistryId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + } + return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go new file mode 100644 index 000000000000..9764cd18a8c2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go @@ -0,0 +1,140 @@ +package webhooks + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = WebHookId{} + +// WebHookId is a struct representing the Resource ID for a Web Hook +type WebHookId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string + WebHookName string +} + +// NewWebHookID returns a new WebHookId struct +func NewWebHookID(subscriptionId string, resourceGroupName string, registryName string, webHookName string) WebHookId { + return WebHookId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + WebHookName: webHookName, + } +} + +// ParseWebHookID parses 'input' into a WebHookId +func ParseWebHookID(input string) (*WebHookId, error) { + parser := resourceids.NewParserFromResourceIdType(WebHookId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WebHookId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.WebHookName, ok = parsed.Parsed["webHookName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "webHookName", *parsed) + } + + return &id, nil +} + +// ParseWebHookIDInsensitively parses 'input' case-insensitively into a WebHookId +// note: this method should only be used for API response data and not user input +func ParseWebHookIDInsensitively(input string) (*WebHookId, error) { + parser := resourceids.NewParserFromResourceIdType(WebHookId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WebHookId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + } + + if id.WebHookName, ok = parsed.Parsed["webHookName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "webHookName", *parsed) + } + + return &id, nil +} + +// ValidateWebHookID checks that 'input' can be parsed as a Web Hook ID +func ValidateWebHookID(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 := ParseWebHookID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Web Hook ID +func (id WebHookId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/webHooks/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.WebHookName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Web Hook ID +func (id WebHookId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), + resourceids.UserSpecifiedSegment("webHookName", "webHookValue"), + } +} + +// String returns a human-readable description of this Web Hook ID +func (id WebHookId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + fmt.Sprintf("Web Hook Name: %q", id.WebHookName), + } + return fmt.Sprintf("Web Hook (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_create.go new file mode 100644 index 000000000000..99d65964fc61 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_create.go @@ -0,0 +1,74 @@ +package webhooks + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Create ... +func (c WebHooksClient) Create(ctx context.Context, id WebHookId, input WebhookCreateParameters) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c WebHooksClient) CreateThenPoll(ctx context.Context, id WebHookId, input WebhookCreateParameters) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_delete.go new file mode 100644 index 000000000000..0ec1675fc794 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_delete.go @@ -0,0 +1,71 @@ +package webhooks + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c WebHooksClient) Delete(ctx context.Context, id WebHookId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c WebHooksClient) DeleteThenPoll(ctx context.Context, id WebHookId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_get.go new file mode 100644 index 000000000000..f604742236ab --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_get.go @@ -0,0 +1,51 @@ +package webhooks + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Webhook +} + +// Get ... +func (c WebHooksClient) Get(ctx context.Context, id WebHookId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_getcallbackconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_getcallbackconfig.go new file mode 100644 index 000000000000..583205eafcee --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_getcallbackconfig.go @@ -0,0 +1,52 @@ +package webhooks + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetCallbackConfigOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *CallbackConfig +} + +// GetCallbackConfig ... +func (c WebHooksClient) GetCallbackConfig(ctx context.Context, id WebHookId) (result GetCallbackConfigOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/getCallbackConfig", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_list.go new file mode 100644 index 000000000000..ee92f466e63c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_list.go @@ -0,0 +1,89 @@ +package webhooks + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Webhook +} + +type ListCompleteResult struct { + Items []Webhook +} + +// List ... +func (c WebHooksClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/webHooks", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]Webhook `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c WebHooksClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, WebhookOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c WebHooksClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate WebhookOperationPredicate) (result ListCompleteResult, err error) { + items := make([]Webhook, 0) + + resp, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_listevents.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_listevents.go new file mode 100644 index 000000000000..47fc1411814c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_listevents.go @@ -0,0 +1,89 @@ +package webhooks + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListEventsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Event +} + +type ListEventsCompleteResult struct { + Items []Event +} + +// ListEvents ... +func (c WebHooksClient) ListEvents(ctx context.Context, id WebHookId) (result ListEventsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listEvents", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]Event `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListEventsComplete retrieves all the results into a single object +func (c WebHooksClient) ListEventsComplete(ctx context.Context, id WebHookId) (ListEventsCompleteResult, error) { + return c.ListEventsCompleteMatchingPredicate(ctx, id, EventOperationPredicate{}) +} + +// ListEventsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c WebHooksClient) ListEventsCompleteMatchingPredicate(ctx context.Context, id WebHookId, predicate EventOperationPredicate) (result ListEventsCompleteResult, err error) { + items := make([]Event, 0) + + resp, err := c.ListEvents(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListEventsCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_ping.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_ping.go new file mode 100644 index 000000000000..d98a8fe33039 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_ping.go @@ -0,0 +1,52 @@ +package webhooks + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PingOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *EventInfo +} + +// Ping ... +func (c WebHooksClient) Ping(ctx context.Context, id WebHookId) (result PingOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/ping", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_update.go new file mode 100644 index 000000000000..c64f7501d196 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_update.go @@ -0,0 +1,74 @@ +package webhooks + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Update ... +func (c WebHooksClient) Update(ctx context.Context, id WebHookId, input WebhookUpdateParameters) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c WebHooksClient) UpdateThenPoll(ctx context.Context, id WebHookId, input WebhookUpdateParameters) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_actor.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_actor.go new file mode 100644 index 000000000000..76f36dcfea3c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_actor.go @@ -0,0 +1,8 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Actor struct { + Name *string `json:"name,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_callbackconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_callbackconfig.go new file mode 100644 index 000000000000..70c51edd7424 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_callbackconfig.go @@ -0,0 +1,9 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CallbackConfig struct { + CustomHeaders *map[string]string `json:"customHeaders,omitempty"` + ServiceUri string `json:"serviceUri"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_event.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_event.go new file mode 100644 index 000000000000..485b94a1cde6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_event.go @@ -0,0 +1,10 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Event struct { + EventRequestMessage *EventRequestMessage `json:"eventRequestMessage,omitempty"` + EventResponseMessage *EventResponseMessage `json:"eventResponseMessage,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventcontent.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventcontent.go new file mode 100644 index 000000000000..ea6b275bec2e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventcontent.go @@ -0,0 +1,32 @@ +package webhooks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EventContent struct { + Action *string `json:"action,omitempty"` + Actor *Actor `json:"actor,omitempty"` + Id *string `json:"id,omitempty"` + Request *Request `json:"request,omitempty"` + Source *Source `json:"source,omitempty"` + Target *Target `json:"target,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *EventContent) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *EventContent) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventinfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventinfo.go new file mode 100644 index 000000000000..87c33e7f07da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventinfo.go @@ -0,0 +1,8 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EventInfo struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventrequestmessage.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventrequestmessage.go new file mode 100644 index 000000000000..56f335b1ea96 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventrequestmessage.go @@ -0,0 +1,12 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EventRequestMessage struct { + Content *EventContent `json:"content,omitempty"` + Headers *map[string]string `json:"headers,omitempty"` + Method *string `json:"method,omitempty"` + RequestUri *string `json:"requestUri,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventresponsemessage.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventresponsemessage.go new file mode 100644 index 000000000000..ece546cd8089 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventresponsemessage.go @@ -0,0 +1,12 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EventResponseMessage struct { + Content *string `json:"content,omitempty"` + Headers *map[string]string `json:"headers,omitempty"` + ReasonPhrase *string `json:"reasonPhrase,omitempty"` + StatusCode *string `json:"statusCode,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_request.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_request.go new file mode 100644 index 000000000000..87e35e6473d7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_request.go @@ -0,0 +1,12 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Request struct { + Addr *string `json:"addr,omitempty"` + Host *string `json:"host,omitempty"` + Id *string `json:"id,omitempty"` + Method *string `json:"method,omitempty"` + Useragent *string `json:"useragent,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_source.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_source.go new file mode 100644 index 000000000000..6c986c31c040 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_source.go @@ -0,0 +1,9 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Source struct { + Addr *string `json:"addr,omitempty"` + InstanceID *string `json:"instanceID,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_target.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_target.go new file mode 100644 index 000000000000..4cbc07d50ded --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_target.go @@ -0,0 +1,16 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Target struct { + Digest *string `json:"digest,omitempty"` + Length *int64 `json:"length,omitempty"` + MediaType *string `json:"mediaType,omitempty"` + Name *string `json:"name,omitempty"` + Repository *string `json:"repository,omitempty"` + Size *int64 `json:"size,omitempty"` + Tag *string `json:"tag,omitempty"` + Url *string `json:"url,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhook.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhook.go new file mode 100644 index 000000000000..66a677d90be4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhook.go @@ -0,0 +1,18 @@ +package webhooks + +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 Webhook struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *WebhookProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookcreateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookcreateparameters.go new file mode 100644 index 000000000000..7a7d23fef424 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookcreateparameters.go @@ -0,0 +1,10 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WebhookCreateParameters struct { + Location string `json:"location"` + Properties *WebhookPropertiesCreateParameters `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookproperties.go new file mode 100644 index 000000000000..987c402d3c1c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookproperties.go @@ -0,0 +1,11 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WebhookProperties struct { + Actions []WebhookAction `json:"actions"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Scope *string `json:"scope,omitempty"` + Status *WebhookStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiescreateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiescreateparameters.go new file mode 100644 index 000000000000..5c31614b8c78 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiescreateparameters.go @@ -0,0 +1,12 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WebhookPropertiesCreateParameters struct { + Actions []WebhookAction `json:"actions"` + CustomHeaders *map[string]string `json:"customHeaders,omitempty"` + Scope *string `json:"scope,omitempty"` + ServiceUri string `json:"serviceUri"` + Status *WebhookStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiesupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiesupdateparameters.go new file mode 100644 index 000000000000..17d1bcfa8ce6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiesupdateparameters.go @@ -0,0 +1,12 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WebhookPropertiesUpdateParameters struct { + Actions *[]WebhookAction `json:"actions,omitempty"` + CustomHeaders *map[string]string `json:"customHeaders,omitempty"` + Scope *string `json:"scope,omitempty"` + ServiceUri *string `json:"serviceUri,omitempty"` + Status *WebhookStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookupdateparameters.go new file mode 100644 index 000000000000..2cf0241fdf6d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookupdateparameters.go @@ -0,0 +1,9 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WebhookUpdateParameters struct { + Properties *WebhookPropertiesUpdateParameters `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/predicates.go new file mode 100644 index 000000000000..946905715c8d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/predicates.go @@ -0,0 +1,45 @@ +package webhooks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EventOperationPredicate struct { + Id *string +} + +func (p EventOperationPredicate) Matches(input Event) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + return true +} + +type WebhookOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p WebhookOperationPredicate) Matches(input Webhook) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/version.go new file mode 100644 index 000000000000..2b33962a2b04 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/version.go @@ -0,0 +1,12 @@ +package webhooks + +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 = "2023-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/webhooks/%s", defaultApiVersion) +} From e30a4319e1dc1c08878c232b7212ef5f1c575b1c Mon Sep 17 00:00:00 2001 From: Mateusz Haligowski Date: Mon, 27 Nov 2023 09:35:27 -0800 Subject: [PATCH 07/74] Create and Read --- .../container_registry_cache_rule_resource.go | 80 ++++++++++++++++++- .../containers/container_registry_resource.go | 2 +- 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 484d9ee95c7e..36db53fab25c 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" containerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" @@ -21,6 +22,9 @@ import ( func resourceContainerRegistryCacheRule() *pluginsdk.Resource { return &pluginsdk.Resource{ + Create: resourceContainerRegistryCacheRuleCreate, + Read: resourceContainerRegistryCacheRuleRead, + Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { _, err := cacherules.ParseCacheRuleID(id) return err @@ -70,6 +74,8 @@ func resourceContainerRegistryCacheRuleSchema() map[string]*pluginsdk.Schema { func resourceContainerRegistryCacheRuleCreate(d *pluginsdk.ResourceData, meta interface{}) error { cacheRulesClient := meta.(*clients.Client).Containers.ContainerRegistryClient_v2023_07_01.CacheRules + operationClient := meta.(*clients.Client).Containers.ContainerRegistryClient_v2023_07_01.Operation + subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) @@ -80,7 +86,7 @@ func resourceContainerRegistryCacheRuleCreate(d *pluginsdk.ResourceData, meta in id := cacherules.NewCacheRuleID(subscriptionId, d.Get("resource_group_name").(string), d.Get("registry").(string), d.Get("name").(string)) if d.IsNewResource() { - existing, err := client.Get(ctx, id) + existing, err := cacheRulesClient.Get(ctx, id) if err != nil { if !response.WasNotFound(existing.HttpResponse) { @@ -93,6 +99,78 @@ func resourceContainerRegistryCacheRuleCreate(d *pluginsdk.ResourceData, meta in } sId := commonids.NewSubscriptionID(subscriptionId) + availabilityRequest := operation.RegistryNameCheckRequest{ + Name: id.CacheRuleName, + Type: "Microsoft.ContainerRegistry/registries/cacheRules", + } + + availabilityResponse, err := operationClient.RegistriesCheckNameAvailability(ctx, sId, availabilityRequest) + if err != nil { + return fmt.Errorf("checking availability of %s: %s", id.CacheRuleName, err) + } + + if availabilityResponse.Model == nil && availabilityResponse.Model.NameAvailable == nil { + return fmt.Errorf("checking availability of %s: unexpected response from API", id.CacheRuleName) + } + + if available := *availabilityResponse.Model.NameAvailable; !available { + return fmt.Errorf("the name %q used for the Container Registry Cache Rule needs to be unique within Container Registry %s and isn't available: %s", id.CacheRuleName, id.RegistryName, *availabilityResponse.Model.Message) + } + + // TODO: make a check that the repo is available in the registry. + targetRepo := d.Get("target_repo").(string) + + // TODO: validate the source repo. + sourceRepo := d.Get("source_repo").(string) + + parameters := cacherules.CacheRule{ + Name: &id.CacheRuleName, + Properties: &cacherules.CacheRuleProperties{ + SourceRepository: &sourceRepo, + TargetRepository: &targetRepo, + }, + } + + if err := cacheRulesClient.CreateThenPoll(ctx, id, parameters); err != nil { + return fmt.Errorf("creating Container Registry Cache Rule %s: %+v", id, err) + } + } + + d.SetId(id.ID()) + + return resourceContainerRegistryCacheRuleRead(d, meta) +} + +func resourceContainerRegistryCacheRuleRead(d *pluginsdk.ResourceData, meta interface{}) error { + cacheRulesClient := meta.(*clients.Client).Containers.ContainerRegistryClient_v2023_07_01.CacheRules + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := cacherules.ParseCacheRuleID(d.Id()) + if err != nil { + return err + } + + resp, err := cacheRulesClient.Get(ctx, *id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + log.Printf("[DEBUG] Container Registry Cache Rule %s was not found.", *id) + d.SetId("") + return nil + } + + return fmt.Errorf("retrieving Container Registry Cache Rule %s: %+v", *id, err) + } + + d.Set("name", id.CacheRuleName) + d.Set("registry", id.RegistryName) + if model := resp.Model; model != nil { + if properties := model.Properties; properties != nil { + d.Set("source_repo", properties.SourceRepository) + d.Set("target_repo", properties.TargetRepository) + } } + + return nil } diff --git a/internal/services/containers/container_registry_resource.go b/internal/services/containers/container_registry_resource.go index 2216f1136bdc..f50fd7abbbe7 100644 --- a/internal/services/containers/container_registry_resource.go +++ b/internal/services/containers/container_registry_resource.go @@ -189,7 +189,7 @@ func resourceContainerRegistryCreate(d *pluginsdk.ResourceData, meta interface{} sId := commonids.NewSubscriptionID(subscriptionId) availabilityRequest := operation.RegistryNameCheckRequest{ Name: id.RegistryName, - Type: "Microsoft.ContainerRegistry/registries", + Type: "Microsoft.ContainerRegistry/registries/cacheRules", } resp, err := operationClient.RegistriesCheckNameAvailability(ctx, sId, availabilityRequest) if err != nil { From c9066b3a6df6724a2f9697fb13fcd28e57d204ed Mon Sep 17 00:00:00 2001 From: Mateusz Haligowski Date: Mon, 27 Nov 2023 16:31:19 -0800 Subject: [PATCH 08/74] add registration and dummy test --- .../container_registry_cache_rule_resource.go | 74 ++++++++------ ...ainer_registry_cache_rule_resource_test.go | 96 ++++++++++++++++++- .../containers/container_registry_resource.go | 2 +- internal/services/containers/registration.go | 1 + 4 files changed, 143 insertions(+), 30 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 36db53fab25c..81811e460dc5 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -9,10 +9,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" containerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" @@ -24,6 +21,8 @@ func resourceContainerRegistryCacheRule() *pluginsdk.Resource { return &pluginsdk.Resource{ Create: resourceContainerRegistryCacheRuleCreate, Read: resourceContainerRegistryCacheRuleRead, + Update: resourceContainerRegistryCacheRuleUpdate, + Delete: resourceContainerRegistryCacheRuleDelete, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { _, err := cacherules.ParseCacheRuleID(id) @@ -37,7 +36,7 @@ func resourceContainerRegistryCacheRule() *pluginsdk.Resource { Delete: pluginsdk.DefaultTimeout(30 * time.Minute), }, - Schema: resourceContainerRegistrySchema(), + Schema: resourceContainerRegistryCacheRuleSchema(), } } @@ -67,17 +66,12 @@ func resourceContainerRegistryCacheRuleSchema() map[string]*pluginsdk.Schema { Required: true, Description: "The target repository namespace such as 'ubuntu'.", }, - - "resource_group_name": commonschema.ResourceGroupName(), } } func resourceContainerRegistryCacheRuleCreate(d *pluginsdk.ResourceData, meta interface{}) error { cacheRulesClient := meta.(*clients.Client).Containers.ContainerRegistryClient_v2023_07_01.CacheRules - operationClient := meta.(*clients.Client).Containers.ContainerRegistryClient_v2023_07_01.Operation - subscriptionId := meta.(*clients.Client).Account.SubscriptionId - ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -98,25 +92,6 @@ func resourceContainerRegistryCacheRuleCreate(d *pluginsdk.ResourceData, meta in return tf.ImportAsExistsError("azurerm_container_registry_cache_rule", id.ID()) } - sId := commonids.NewSubscriptionID(subscriptionId) - availabilityRequest := operation.RegistryNameCheckRequest{ - Name: id.CacheRuleName, - Type: "Microsoft.ContainerRegistry/registries/cacheRules", - } - - availabilityResponse, err := operationClient.RegistriesCheckNameAvailability(ctx, sId, availabilityRequest) - if err != nil { - return fmt.Errorf("checking availability of %s: %s", id.CacheRuleName, err) - } - - if availabilityResponse.Model == nil && availabilityResponse.Model.NameAvailable == nil { - return fmt.Errorf("checking availability of %s: unexpected response from API", id.CacheRuleName) - } - - if available := *availabilityResponse.Model.NameAvailable; !available { - return fmt.Errorf("the name %q used for the Container Registry Cache Rule needs to be unique within Container Registry %s and isn't available: %s", id.CacheRuleName, id.RegistryName, *availabilityResponse.Model.Message) - } - // TODO: make a check that the repo is available in the registry. targetRepo := d.Get("target_repo").(string) @@ -174,3 +149,46 @@ func resourceContainerRegistryCacheRuleRead(d *pluginsdk.ResourceData, meta inte return nil } + +func resourceContainerRegistryCacheRuleUpdate(d *pluginsdk.ResourceData, meta interface{}) error { + cacheRulesClient := meta.(*clients.Client).Containers.ContainerRegistryClient_v2023_07_01.CacheRules + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + + defer cancel() + log.Printf("[INFO] preparing arguments for Container Registry Cache Rule update.") + + id, err := cacherules.ParseCacheRuleID(d.Id()) + if err != nil { + return err + } + + // TODO: You can only update the credential set. To be implemented + parameters := cacherules.CacheRuleUpdateParameters{ + Properties: &cacherules.CacheRuleUpdateProperties{}, + } + + if err := cacheRulesClient.UpdateThenPoll(ctx, *id, parameters); err != nil { + return fmt.Errorf("updating %s: %+v", id, err) + } + + d.SetId(id.ID()) + + return resourceContainerRegistryRead(d, meta) +} + +func resourceContainerRegistryCacheRuleDelete(d *pluginsdk.ResourceData, meta interface{}) error { + cacheRulesClient := meta.(*clients.Client).Containers.ContainerRegistryClient_v2023_07_01.CacheRules + ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := cacherules.ParseCacheRuleID(d.Id()) + if err != nil { + return err + } + + if err := cacheRulesClient.DeleteThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting Container Registry Cache Rule %s: %+v", *id, err) + } + + return nil +} diff --git a/internal/services/containers/container_registry_cache_rule_resource_test.go b/internal/services/containers/container_registry_cache_rule_resource_test.go index 1d386c2e22b2..17871e79d0e3 100644 --- a/internal/services/containers/container_registry_cache_rule_resource_test.go +++ b/internal/services/containers/container_registry_cache_rule_resource_test.go @@ -1,12 +1,20 @@ package containers_test import ( + "context" + "fmt" "testing" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/utils" ) -type ContainerRegistryCacheRule struct{} +type ContainerRegistryCacheRuleResource struct{} func TestAccContainerRegistryCacheRuleName_validation(t *testing.T) { cases := []struct { @@ -71,3 +79,89 @@ func TestAccContainerRegistryCacheRuleName_validation(t *testing.T) { } } } + +func TestAccContainerRegistryCacheRule_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_container_registry_cache_rule", "test") + r := ContainerRegistryCacheRuleResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccContainerRegistryCacheRule_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_container_registry_cache_rule", "test") + r := ContainerRegistryCacheRuleResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + { + Config: r.requiresImport(data), + ExpectError: acceptance.RequiresImportError("azurerm_container_registry_cache_rule"), + }, + }) +} + +func (t ContainerRegistryCacheRuleResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := cacherules.ParseCacheRuleID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.Containers.ContainerRegistryClient_v2023_07_01.CacheRules.Get(ctx, *id) + if err != nil { + return nil, fmt.Errorf("retrieving %s: %+v", id, err) + } + + return utils.Bool(resp.Model != nil), nil +} + +func (ContainerRegistryCacheRuleResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "accTestRG-acr-cache-rule-%d" + location = "%s" +} + +resource "azurerm_container_registry" "test" { + name = "testacccr%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku = "Basic" +} + +resource "azurerm_container_registry_cache_rule" "test" { + name = "testacc-cr-cache-rule-%d" + resource_group_name = azurerm_resource_group.test.name + registry = azurerm_container_registry.test.name + target_repo = "target" + source_repo = "docker.io/hello-world" +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +} + +func (r ContainerRegistryCacheRuleResource) requiresImport(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_container_registry_cache_rule" "import" { + name = azurerm_container_registry_cache_rule.test.name + resource_group_name = azurerm_container_registry_cache_rule.test.resource_group_name +} +`, r.basic(data)) +} diff --git a/internal/services/containers/container_registry_resource.go b/internal/services/containers/container_registry_resource.go index f50fd7abbbe7..2216f1136bdc 100644 --- a/internal/services/containers/container_registry_resource.go +++ b/internal/services/containers/container_registry_resource.go @@ -189,7 +189,7 @@ func resourceContainerRegistryCreate(d *pluginsdk.ResourceData, meta interface{} sId := commonids.NewSubscriptionID(subscriptionId) availabilityRequest := operation.RegistryNameCheckRequest{ Name: id.RegistryName, - Type: "Microsoft.ContainerRegistry/registries/cacheRules", + Type: "Microsoft.ContainerRegistry/registries", } resp, err := operationClient.RegistriesCheckNameAvailability(ctx, sId, availabilityRequest) if err != nil { diff --git a/internal/services/containers/registration.go b/internal/services/containers/registration.go index de6d0cb250dd..971a7c304d84 100644 --- a/internal/services/containers/registration.go +++ b/internal/services/containers/registration.go @@ -51,6 +51,7 @@ func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { "azurerm_container_registry_agent_pool": resourceContainerRegistryAgentPool(), "azurerm_container_registry_webhook": resourceContainerRegistryWebhook(), "azurerm_container_registry": resourceContainerRegistry(), + "azurerm_container_registry_cache_rule": resourceContainerRegistryCacheRule(), "azurerm_container_registry_token": resourceContainerRegistryToken(), "azurerm_container_registry_scope_map": resourceContainerRegistryScopeMap(), "azurerm_kubernetes_cluster": resourceKubernetesCluster(), From cd96b0a990446aa5e97e109dfe7107a6c9325516 Mon Sep 17 00:00:00 2001 From: Mateusz Haligowski Date: Mon, 11 Dec 2023 00:31:52 -0800 Subject: [PATCH 09/74] Adjust for the correct layout --- .../container_registry_cache_rule_resource.go | 254 ++++++++++-------- internal/services/containers/registration.go | 2 +- 2 files changed, 139 insertions(+), 117 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 81811e460dc5..e506b6bd30d5 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -4,6 +4,7 @@ package containers import ( + "context" "fmt" "log" "time" @@ -11,36 +12,18 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" - "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" containerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" ) -func resourceContainerRegistryCacheRule() *pluginsdk.Resource { - return &pluginsdk.Resource{ - Create: resourceContainerRegistryCacheRuleCreate, - Read: resourceContainerRegistryCacheRuleRead, - Update: resourceContainerRegistryCacheRuleUpdate, - Delete: resourceContainerRegistryCacheRuleDelete, - - Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := cacherules.ParseCacheRuleID(id) - return err - }), - - Timeouts: &pluginsdk.ResourceTimeout{ - Create: pluginsdk.DefaultTimeout(30 * time.Minute), - Read: pluginsdk.DefaultTimeout(5 * time.Minute), - Update: pluginsdk.DefaultTimeout(30 * time.Minute), - Delete: pluginsdk.DefaultTimeout(30 * time.Minute), - }, +var _ sdk.Resource = ContainerRegistryCacheRule{} - Schema: resourceContainerRegistryCacheRuleSchema(), - } -} +type ContainerRegistryCacheRule struct{} -func resourceContainerRegistryCacheRuleSchema() map[string]*pluginsdk.Schema { +func (ContainerRegistryCacheRule) Arguments() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, @@ -69,126 +52,165 @@ func resourceContainerRegistryCacheRuleSchema() map[string]*pluginsdk.Schema { } } -func resourceContainerRegistryCacheRuleCreate(d *pluginsdk.ResourceData, meta interface{}) error { - cacheRulesClient := meta.(*clients.Client).Containers.ContainerRegistryClient_v2023_07_01.CacheRules - subscriptionId := meta.(*clients.Client).Account.SubscriptionId - ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) - - defer cancel() - log.Printf("[INFO] preparing arguments for Container Registry Cache Rule creation.") +func (ContainerRegistryCacheRule) Attributes() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{} +} - id := cacherules.NewCacheRuleID(subscriptionId, d.Get("resource_group_name").(string), d.Get("registry").(string), d.Get("name").(string)) +func (ContainerRegistryCacheRule) ModelObject() interface{} { + return nil +} - if d.IsNewResource() { - existing, err := cacheRulesClient.Get(ctx, id) +func (ContainerRegistryCacheRule) ResourceType() string { + return "azurerm_container_registry_cache_rule" +} - if err != nil { - if !response.WasNotFound(existing.HttpResponse) { - return fmt.Errorf("checking for presence of existing %s: %s", id, err) +func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + cacheRulesClient := metadata.Client.Containers.ContainerRegistryClient_v2023_07_01.CacheRules + subscriptionId := metadata.Client.Account.SubscriptionId + ctx, cancel := timeouts.ForCreate(metadata.Client.StopContext, metadata.ResourceData) + + defer cancel() + log.Printf("[INFO] preparing arguments for Container Registry Cache Rule creation.") + + id := cacherules.NewCacheRuleID(subscriptionId, + metadata.ResourceData.Get("resource_group_name").(string), + metadata.ResourceData.Get("registry").(string), + metadata.ResourceData.Get("name").(string), + ) + + if metadata.ResourceData.IsNewResource() { + existing, err := cacheRulesClient.Get(ctx, id) + + if err != nil { + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for presence of existing %s: %s", id, err) + } + } + + if !response.WasNotFound(existing.HttpResponse) { + return tf.ImportAsExistsError("azurerm_container_registry_cache_rule", id.ID()) + } + + // TODO: make a check that the repo is available in the registry. + targetRepo := metadata.ResourceData.Get("target_repo").(string) + + // TODO: validate the source repo. + sourceRepo := metadata.ResourceData.Get("source_repo").(string) + + parameters := cacherules.CacheRule{ + Name: &id.CacheRuleName, + Properties: &cacherules.CacheRuleProperties{ + SourceRepository: &sourceRepo, + TargetRepository: &targetRepo, + }, + } + + if err := cacheRulesClient.CreateThenPoll(ctx, id, parameters); err != nil { + return fmt.Errorf("creating Container Registry Cache Rule %s: %+v", id, err) + } } - } - - if !response.WasNotFound(existing.HttpResponse) { - return tf.ImportAsExistsError("azurerm_container_registry_cache_rule", id.ID()) - } - - // TODO: make a check that the repo is available in the registry. - targetRepo := d.Get("target_repo").(string) - // TODO: validate the source repo. - sourceRepo := d.Get("source_repo").(string) + metadata.SetID(id) - parameters := cacherules.CacheRule{ - Name: &id.CacheRuleName, - Properties: &cacherules.CacheRuleProperties{ - SourceRepository: &sourceRepo, - TargetRepository: &targetRepo, - }, - } - - if err := cacheRulesClient.CreateThenPoll(ctx, id, parameters); err != nil { - return fmt.Errorf("creating Container Registry Cache Rule %s: %+v", id, err) - } + return r.Read().Func(ctx, metadata) + }, } - - d.SetId(id.ID()) - - return resourceContainerRegistryCacheRuleRead(d, meta) } -func resourceContainerRegistryCacheRuleRead(d *pluginsdk.ResourceData, meta interface{}) error { - cacheRulesClient := meta.(*clients.Client).Containers.ContainerRegistryClient_v2023_07_01.CacheRules - ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) - defer cancel() +func (ContainerRegistryCacheRule) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + cacheRulesClient := metadata.Client.Containers.ContainerRegistryClient_v2023_07_01.CacheRules + ctx, cancel := timeouts.ForRead(metadata.Client.StopContext, metadata.ResourceData) + defer cancel() + + id, err := cacherules.ParseCacheRuleID(metadata.ResourceData.Id()) + if err != nil { + return err + } - id, err := cacherules.ParseCacheRuleID(d.Id()) - if err != nil { - return err - } + resp, err := cacheRulesClient.Get(ctx, *id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + log.Printf("[DEBUG] Container Registry Cache Rule %s was not found.", *id) + return metadata.MarkAsGone(id) + } - resp, err := cacheRulesClient.Get(ctx, *id) - if err != nil { - if response.WasNotFound(resp.HttpResponse) { - log.Printf("[DEBUG] Container Registry Cache Rule %s was not found.", *id) - d.SetId("") - return nil - } + return fmt.Errorf("retrieving Container Registry Cache Rule %s: %+v", *id, err) + } - return fmt.Errorf("retrieving Container Registry Cache Rule %s: %+v", *id, err) - } + metadata.ResourceData.Set("name", id.CacheRuleName) + metadata.ResourceData.Set("registry", id.RegistryName) - d.Set("name", id.CacheRuleName) - d.Set("registry", id.RegistryName) + if model := resp.Model; model != nil { + if properties := model.Properties; properties != nil { + metadata.ResourceData.Set("source_repo", properties.SourceRepository) + metadata.ResourceData.Set("target_repo", properties.TargetRepository) + } + } - if model := resp.Model; model != nil { - if properties := model.Properties; properties != nil { - d.Set("source_repo", properties.SourceRepository) - d.Set("target_repo", properties.TargetRepository) - } + return nil + }, } - - return nil } -func resourceContainerRegistryCacheRuleUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - cacheRulesClient := meta.(*clients.Client).Containers.ContainerRegistryClient_v2023_07_01.CacheRules - ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) +func (r ContainerRegistryCacheRule) Update() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + cacheRulesClient := metadata.Client.Containers.ContainerRegistryClient_v2023_07_01.CacheRules + ctx, cancel := timeouts.ForRead(metadata.Client.StopContext, metadata.ResourceData) - defer cancel() - log.Printf("[INFO] preparing arguments for Container Registry Cache Rule update.") + defer cancel() + log.Printf("[INFO] preparing arguments for Container Registry Cache Rule update.") - id, err := cacherules.ParseCacheRuleID(d.Id()) - if err != nil { - return err - } + id, err := cacherules.ParseCacheRuleID(metadata.ResourceData.Id()) + if err != nil { + return err + } - // TODO: You can only update the credential set. To be implemented - parameters := cacherules.CacheRuleUpdateParameters{ - Properties: &cacherules.CacheRuleUpdateProperties{}, - } + // TODO: You can only update the credential set. To be implemented + parameters := cacherules.CacheRuleUpdateParameters{ + Properties: &cacherules.CacheRuleUpdateProperties{}, + } - if err := cacheRulesClient.UpdateThenPoll(ctx, *id, parameters); err != nil { - return fmt.Errorf("updating %s: %+v", id, err) - } + if err := cacheRulesClient.UpdateThenPoll(ctx, *id, parameters); err != nil { + return fmt.Errorf("updating %s: %+v", id, err) + } - d.SetId(id.ID()) + metadata.SetID(id) - return resourceContainerRegistryRead(d, meta) + return nil + }, + } } -func resourceContainerRegistryCacheRuleDelete(d *pluginsdk.ResourceData, meta interface{}) error { - cacheRulesClient := meta.(*clients.Client).Containers.ContainerRegistryClient_v2023_07_01.CacheRules - ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) - defer cancel() +func (ContainerRegistryCacheRule) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + cacheRulesClient := metadata.Client.Containers.ContainerRegistryClient_v2023_07_01.CacheRules + ctx, cancel := timeouts.ForDelete(metadata.Client.StopContext, metadata.ResourceData) + defer cancel() + + id, err := cacherules.ParseCacheRuleID(metadata.ResourceData.Id()) + if err != nil { + return err + } - id, err := cacherules.ParseCacheRuleID(d.Id()) - if err != nil { - return err - } + if err := cacheRulesClient.DeleteThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting Container Registry Cache Rule %s: %+v", *id, err) + } - if err := cacheRulesClient.DeleteThenPoll(ctx, *id); err != nil { - return fmt.Errorf("deleting Container Registry Cache Rule %s: %+v", *id, err) + return nil + }, } +} - return nil +func (ContainerRegistryCacheRule) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return validate.ContainerRegistryCacheRuleID } diff --git a/internal/services/containers/registration.go b/internal/services/containers/registration.go index 971a7c304d84..623bf277351f 100644 --- a/internal/services/containers/registration.go +++ b/internal/services/containers/registration.go @@ -51,7 +51,6 @@ func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { "azurerm_container_registry_agent_pool": resourceContainerRegistryAgentPool(), "azurerm_container_registry_webhook": resourceContainerRegistryWebhook(), "azurerm_container_registry": resourceContainerRegistry(), - "azurerm_container_registry_cache_rule": resourceContainerRegistryCacheRule(), "azurerm_container_registry_token": resourceContainerRegistryToken(), "azurerm_container_registry_scope_map": resourceContainerRegistryScopeMap(), "azurerm_kubernetes_cluster": resourceKubernetesCluster(), @@ -69,6 +68,7 @@ func (r Registration) DataSources() []sdk.DataSource { func (r Registration) Resources() []sdk.Resource { resources := []sdk.Resource{ + ContainerRegistryCacheRule{}, ContainerRegistryTaskResource{}, ContainerRegistryTaskScheduleResource{}, ContainerRegistryTokenPasswordResource{}, From b38267297b33ce1b94e34df456043288712c8c9b Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Mon, 20 May 2024 15:52:49 -0400 Subject: [PATCH 10/74] Fix the vendor versions --- .../2023-07-01/cacherules/id_cacherule.go | 57 +++++++++---------- .../2023-07-01/cacherules/id_registry.go | 49 ++++++++-------- .../2023-07-01/cacherules/method_create.go | 1 + .../2023-07-01/cacherules/method_get.go | 5 +- .../2023-07-01/cacherules/method_list.go | 6 +- .../2023-07-01/cacherules/method_update.go | 1 + .../credentialsets/id_credentialset.go | 57 +++++++++---------- .../2023-07-01/credentialsets/id_registry.go | 49 ++++++++-------- .../credentialsets/method_create.go | 1 + .../2023-07-01/credentialsets/method_get.go | 5 +- .../2023-07-01/credentialsets/method_list.go | 6 +- .../credentialsets/method_update.go | 1 + .../2023-07-01/operation/README.md | 3 +- .../method_registrieschecknameavailability.go | 5 +- .../id_privateendpointconnection.go | 57 +++++++++---------- .../privateendpointconnections/id_registry.go | 49 ++++++++-------- .../method_createorupdate.go | 1 + .../privateendpointconnections/method_get.go | 5 +- .../privateendpointconnections/method_list.go | 6 +- .../2023-07-01/registries/README.md | 5 +- .../registries/id_privatelinkresource.go | 57 +++++++++---------- .../2023-07-01/registries/id_registry.go | 49 ++++++++-------- .../2023-07-01/registries/method_create.go | 1 + .../registries/method_generatecredentials.go | 1 + .../2023-07-01/registries/method_get.go | 5 +- .../method_getprivatelinkresource.go | 5 +- .../2023-07-01/registries/method_list.go | 6 +- .../registries/method_listbyresourcegroup.go | 6 +- .../registries/method_listcredentials.go | 5 +- .../method_listprivatelinkresources.go | 6 +- .../registries/method_listusages.go | 5 +- .../registries/method_regeneratecredential.go | 5 +- .../2023-07-01/registries/method_update.go | 1 + .../2023-07-01/replications/id_registry.go | 49 ++++++++-------- .../2023-07-01/replications/id_replication.go | 57 +++++++++---------- .../2023-07-01/replications/method_create.go | 1 + .../2023-07-01/replications/method_get.go | 5 +- .../2023-07-01/replications/method_list.go | 6 +- .../2023-07-01/replications/method_update.go | 1 + .../2023-07-01/scopemaps/id_registry.go | 49 ++++++++-------- .../2023-07-01/scopemaps/id_scopemap.go | 57 +++++++++---------- .../2023-07-01/scopemaps/method_create.go | 1 + .../2023-07-01/scopemaps/method_get.go | 5 +- .../2023-07-01/scopemaps/method_list.go | 6 +- .../2023-07-01/scopemaps/method_update.go | 1 + .../2023-07-01/tokens/id_registry.go | 49 ++++++++-------- .../2023-07-01/tokens/id_token.go | 57 +++++++++---------- .../2023-07-01/tokens/method_create.go | 1 + .../2023-07-01/tokens/method_get.go | 5 +- .../2023-07-01/tokens/method_list.go | 6 +- .../2023-07-01/tokens/method_update.go | 1 + .../2023-07-01/webhooks/id_registry.go | 49 ++++++++-------- .../2023-07-01/webhooks/id_webhook.go | 57 +++++++++---------- .../2023-07-01/webhooks/method_create.go | 1 + .../2023-07-01/webhooks/method_get.go | 5 +- .../webhooks/method_getcallbackconfig.go | 5 +- .../2023-07-01/webhooks/method_list.go | 6 +- .../2023-07-01/webhooks/method_listevents.go | 6 +- .../2023-07-01/webhooks/method_ping.go | 5 +- .../2023-07-01/webhooks/method_update.go | 1 + 60 files changed, 557 insertions(+), 456 deletions(-) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_cacherule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_cacherule.go index ffa12165199e..47244dd517b1 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_cacherule.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_cacherule.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = CacheRuleId{} +func init() { + recaser.RegisterResourceId(&CacheRuleId{}) +} + +var _ resourceids.ResourceId = &CacheRuleId{} // CacheRuleId is a struct representing the Resource ID for a Cache Rule type CacheRuleId struct { @@ -32,29 +37,15 @@ func NewCacheRuleID(subscriptionId string, resourceGroupName string, registryNam // ParseCacheRuleID parses 'input' into a CacheRuleId func ParseCacheRuleID(input string) (*CacheRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(CacheRuleId{}) + parser := resourceids.NewParserFromResourceIdType(&CacheRuleId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := CacheRuleId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) - } - - if id.CacheRuleName, ok = parsed.Parsed["cacheRuleName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "cacheRuleName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -63,32 +54,40 @@ func ParseCacheRuleID(input string) (*CacheRuleId, error) { // ParseCacheRuleIDInsensitively parses 'input' case-insensitively into a CacheRuleId // note: this method should only be used for API response data and not user input func ParseCacheRuleIDInsensitively(input string) (*CacheRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(CacheRuleId{}) + parser := resourceids.NewParserFromResourceIdType(&CacheRuleId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := CacheRuleId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + return &id, nil +} + +func (id *CacheRuleId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - if id.CacheRuleName, ok = parsed.Parsed["cacheRuleName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "cacheRuleName", *parsed) + if id.CacheRuleName, ok = input.Parsed["cacheRuleName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "cacheRuleName", input) } - return &id, nil + return nil } // ValidateCacheRuleID checks that 'input' can be parsed as a Cache Rule ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_registry.go index 7b505f5e932c..e60010c55ea6 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_registry.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/id_registry.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = RegistryId{} +func init() { + recaser.RegisterResourceId(&RegistryId{}) +} + +var _ resourceids.ResourceId = &RegistryId{} // RegistryId is a struct representing the Resource ID for a Registry type RegistryId struct { @@ -30,25 +35,15 @@ func NewRegistryID(subscriptionId string, resourceGroupName string, registryName // ParseRegistryID parses 'input' into a RegistryId func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -57,28 +52,36 @@ func ParseRegistryID(input string) (*RegistryId, error) { // ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId // note: this method should only be used for API response data and not user input func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { + var ok bool - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - return &id, nil + return nil } // ValidateRegistryID checks that 'input' can be parsed as a Registry ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_create.go index a61f1944242f..e5af51fd1792 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_create.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_create.go @@ -18,6 +18,7 @@ type CreateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *CacheRule } // Create ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_get.go index ccfba814ee34..8514302dbc33 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_get.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_get.go @@ -43,7 +43,10 @@ func (c CacheRulesClient) Get(ctx context.Context, id CacheRuleId) (result GetOp return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model CacheRule + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_list.go index 924f369db856..51da42d2dc5a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_list.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_list.go @@ -19,7 +19,8 @@ type ListOperationResponse struct { } type ListCompleteResult struct { - Items []CacheRule + LatestHttpResponse *http.Response + Items []CacheRule } // List ... @@ -83,7 +84,8 @@ func (c CacheRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id } result = ListCompleteResult{ - Items: items, + LatestHttpResponse: resp.HttpResponse, + Items: items, } return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_update.go index 46078cdbf676..52c930db6d41 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_update.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_update.go @@ -18,6 +18,7 @@ type UpdateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *CacheRule } // Update ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go index 4861a1140199..2538c5cf3110 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = CredentialSetId{} +func init() { + recaser.RegisterResourceId(&CredentialSetId{}) +} + +var _ resourceids.ResourceId = &CredentialSetId{} // CredentialSetId is a struct representing the Resource ID for a Credential Set type CredentialSetId struct { @@ -32,29 +37,15 @@ func NewCredentialSetID(subscriptionId string, resourceGroupName string, registr // ParseCredentialSetID parses 'input' into a CredentialSetId func ParseCredentialSetID(input string) (*CredentialSetId, error) { - parser := resourceids.NewParserFromResourceIdType(CredentialSetId{}) + parser := resourceids.NewParserFromResourceIdType(&CredentialSetId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := CredentialSetId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) - } - - if id.CredentialSetName, ok = parsed.Parsed["credentialSetName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "credentialSetName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -63,32 +54,40 @@ func ParseCredentialSetID(input string) (*CredentialSetId, error) { // ParseCredentialSetIDInsensitively parses 'input' case-insensitively into a CredentialSetId // note: this method should only be used for API response data and not user input func ParseCredentialSetIDInsensitively(input string) (*CredentialSetId, error) { - parser := resourceids.NewParserFromResourceIdType(CredentialSetId{}) + parser := resourceids.NewParserFromResourceIdType(&CredentialSetId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := CredentialSetId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + return &id, nil +} + +func (id *CredentialSetId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - if id.CredentialSetName, ok = parsed.Parsed["credentialSetName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "credentialSetName", *parsed) + if id.CredentialSetName, ok = input.Parsed["credentialSetName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "credentialSetName", input) } - return &id, nil + return nil } // ValidateCredentialSetID checks that 'input' can be parsed as a Credential Set ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go index a791778caf4d..e688b3adba09 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = RegistryId{} +func init() { + recaser.RegisterResourceId(&RegistryId{}) +} + +var _ resourceids.ResourceId = &RegistryId{} // RegistryId is a struct representing the Resource ID for a Registry type RegistryId struct { @@ -30,25 +35,15 @@ func NewRegistryID(subscriptionId string, resourceGroupName string, registryName // ParseRegistryID parses 'input' into a RegistryId func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -57,28 +52,36 @@ func ParseRegistryID(input string) (*RegistryId, error) { // ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId // note: this method should only be used for API response data and not user input func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { + var ok bool - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - return &id, nil + return nil } // ValidateRegistryID checks that 'input' can be parsed as a Registry ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go index 61bdf6bc47aa..63256806132e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go @@ -18,6 +18,7 @@ type CreateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *CredentialSet } // Create ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go index 38e03ae42dd2..83eef1b0ac5e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go @@ -43,7 +43,10 @@ func (c CredentialSetsClient) Get(ctx context.Context, id CredentialSetId) (resu return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model CredentialSet + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go index f3d5ed37de07..4b5743c50e66 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go @@ -19,7 +19,8 @@ type ListOperationResponse struct { } type ListCompleteResult struct { - Items []CredentialSet + LatestHttpResponse *http.Response + Items []CredentialSet } // List ... @@ -83,7 +84,8 @@ func (c CredentialSetsClient) ListCompleteMatchingPredicate(ctx context.Context, } result = ListCompleteResult{ - Items: items, + LatestHttpResponse: resp.HttpResponse, + Items: items, } return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go index d1aec5b11743..5451fc9ae4a8 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go @@ -18,6 +18,7 @@ type UpdateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *CredentialSet } // Update ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/README.md index 1dc6531b52b7..edfbd6ac3dba 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/README.md @@ -8,6 +8,7 @@ This readme covers example usages, but further information on [using this SDK ca ### Import Path ```go +import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" import "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation" ``` @@ -24,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := operation.NewSubscriptionID("12345678-1234-9876-4563-123456789012") +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") payload := operation.RegistryNameCheckRequest{ // ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/method_registrieschecknameavailability.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/method_registrieschecknameavailability.go index 4a73c3622a06..975fa300016e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/method_registrieschecknameavailability.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/method_registrieschecknameavailability.go @@ -49,7 +49,10 @@ func (c OperationClient) RegistriesCheckNameAvailability(ctx context.Context, id return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model RegistryNameStatus + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_privateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_privateendpointconnection.go index cfcb50d14bec..3a5c1c4d378f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_privateendpointconnection.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_privateendpointconnection.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = PrivateEndpointConnectionId{} +func init() { + recaser.RegisterResourceId(&PrivateEndpointConnectionId{}) +} + +var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} // PrivateEndpointConnectionId is a struct representing the Resource ID for a Private Endpoint Connection type PrivateEndpointConnectionId struct { @@ -32,29 +37,15 @@ func NewPrivateEndpointConnectionID(subscriptionId string, resourceGroupName str // ParsePrivateEndpointConnectionID parses 'input' into a PrivateEndpointConnectionId func ParsePrivateEndpointConnectionID(input string) (*PrivateEndpointConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(PrivateEndpointConnectionId{}) + parser := resourceids.NewParserFromResourceIdType(&PrivateEndpointConnectionId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := PrivateEndpointConnectionId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) - } - - if id.PrivateEndpointConnectionName, ok = parsed.Parsed["privateEndpointConnectionName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointConnectionName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -63,32 +54,40 @@ func ParsePrivateEndpointConnectionID(input string) (*PrivateEndpointConnectionI // ParsePrivateEndpointConnectionIDInsensitively parses 'input' case-insensitively into a PrivateEndpointConnectionId // note: this method should only be used for API response data and not user input func ParsePrivateEndpointConnectionIDInsensitively(input string) (*PrivateEndpointConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(PrivateEndpointConnectionId{}) + parser := resourceids.NewParserFromResourceIdType(&PrivateEndpointConnectionId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := PrivateEndpointConnectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + return &id, nil +} + +func (id *PrivateEndpointConnectionId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - if id.PrivateEndpointConnectionName, ok = parsed.Parsed["privateEndpointConnectionName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointConnectionName", *parsed) + if id.PrivateEndpointConnectionName, ok = input.Parsed["privateEndpointConnectionName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointConnectionName", input) } - return &id, nil + return nil } // ValidatePrivateEndpointConnectionID checks that 'input' can be parsed as a Private Endpoint Connection ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_registry.go index 1adc54deebd6..109960059c43 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_registry.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_registry.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = RegistryId{} +func init() { + recaser.RegisterResourceId(&RegistryId{}) +} + +var _ resourceids.ResourceId = &RegistryId{} // RegistryId is a struct representing the Resource ID for a Registry type RegistryId struct { @@ -30,25 +35,15 @@ func NewRegistryID(subscriptionId string, resourceGroupName string, registryName // ParseRegistryID parses 'input' into a RegistryId func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -57,28 +52,36 @@ func ParseRegistryID(input string) (*RegistryId, error) { // ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId // note: this method should only be used for API response data and not user input func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { + var ok bool - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - return &id, nil + return nil } // ValidateRegistryID checks that 'input' can be parsed as a Registry ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_createorupdate.go index a0ef13382f23..73fb1683a66c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_createorupdate.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_createorupdate.go @@ -18,6 +18,7 @@ type CreateOrUpdateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *PrivateEndpointConnection } // CreateOrUpdate ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_get.go index 6aeba2f77f92..8dc28d7ff7af 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_get.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_get.go @@ -43,7 +43,10 @@ func (c PrivateEndpointConnectionsClient) Get(ctx context.Context, id PrivateEnd return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model PrivateEndpointConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_list.go index 29dda338117a..9cd4e62acb0f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_list.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_list.go @@ -19,7 +19,8 @@ type ListOperationResponse struct { } type ListCompleteResult struct { - Items []PrivateEndpointConnection + LatestHttpResponse *http.Response + Items []PrivateEndpointConnection } // List ... @@ -83,7 +84,8 @@ func (c PrivateEndpointConnectionsClient) ListCompleteMatchingPredicate(ctx cont } result = ListCompleteResult{ - Items: items, + LatestHttpResponse: resp.HttpResponse, + Items: items, } return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/README.md index 88ddb567f0fb..5e8f78ccc903 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/README.md @@ -8,6 +8,7 @@ This readme covers example usages, but further information on [using this SDK ca ### Import Path ```go +import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" import "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries" ``` @@ -119,7 +120,7 @@ if err := client.ImportImageThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := registries.NewSubscriptionID("12345678-1234-9876-4563-123456789012") +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -136,7 +137,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := registries.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") // alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ListByResourceGroupComplete(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go index 1a9ba519f8ad..ebf2b8bcac5f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = PrivateLinkResourceId{} +func init() { + recaser.RegisterResourceId(&PrivateLinkResourceId{}) +} + +var _ resourceids.ResourceId = &PrivateLinkResourceId{} // PrivateLinkResourceId is a struct representing the Resource ID for a Private Link Resource type PrivateLinkResourceId struct { @@ -32,29 +37,15 @@ func NewPrivateLinkResourceID(subscriptionId string, resourceGroupName string, r // ParsePrivateLinkResourceID parses 'input' into a PrivateLinkResourceId func ParsePrivateLinkResourceID(input string) (*PrivateLinkResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(PrivateLinkResourceId{}) + parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := PrivateLinkResourceId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) - } - - if id.PrivateLinkResourceName, ok = parsed.Parsed["privateLinkResourceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "privateLinkResourceName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -63,32 +54,40 @@ func ParsePrivateLinkResourceID(input string) (*PrivateLinkResourceId, error) { // ParsePrivateLinkResourceIDInsensitively parses 'input' case-insensitively into a PrivateLinkResourceId // note: this method should only be used for API response data and not user input func ParsePrivateLinkResourceIDInsensitively(input string) (*PrivateLinkResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(PrivateLinkResourceId{}) + parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := PrivateLinkResourceId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + return &id, nil +} + +func (id *PrivateLinkResourceId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - if id.PrivateLinkResourceName, ok = parsed.Parsed["privateLinkResourceName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "privateLinkResourceName", *parsed) + if id.PrivateLinkResourceName, ok = input.Parsed["privateLinkResourceName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkResourceName", input) } - return &id, nil + return nil } // ValidatePrivateLinkResourceID checks that 'input' can be parsed as a Private Link Resource ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_registry.go index e45e8501b3ff..ced90cd79e7a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_registry.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_registry.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = RegistryId{} +func init() { + recaser.RegisterResourceId(&RegistryId{}) +} + +var _ resourceids.ResourceId = &RegistryId{} // RegistryId is a struct representing the Resource ID for a Registry type RegistryId struct { @@ -30,25 +35,15 @@ func NewRegistryID(subscriptionId string, resourceGroupName string, registryName // ParseRegistryID parses 'input' into a RegistryId func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -57,28 +52,36 @@ func ParseRegistryID(input string) (*RegistryId, error) { // ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId // note: this method should only be used for API response data and not user input func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { + var ok bool - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - return &id, nil + return nil } // ValidateRegistryID checks that 'input' can be parsed as a Registry ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_create.go index 8ef319b31346..5b8db55a0b05 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_create.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_create.go @@ -18,6 +18,7 @@ type CreateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *Registry } // Create ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_generatecredentials.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_generatecredentials.go index 6d1429c52b9d..12d06ca2ab40 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_generatecredentials.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_generatecredentials.go @@ -18,6 +18,7 @@ type GenerateCredentialsOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *GenerateCredentialsResult } // GenerateCredentials ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_get.go index 406a8fb3aec1..bfd0c8119211 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_get.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_get.go @@ -43,7 +43,10 @@ func (c RegistriesClient) Get(ctx context.Context, id RegistryId) (result GetOpe return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model Registry + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_getprivatelinkresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_getprivatelinkresource.go index 484d73f99cd5..1f017340494c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_getprivatelinkresource.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_getprivatelinkresource.go @@ -43,7 +43,10 @@ func (c RegistriesClient) GetPrivateLinkResource(ctx context.Context, id Private return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model PrivateLinkResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_list.go index 5fab07107b41..766fbb43fd1f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_list.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_list.go @@ -20,7 +20,8 @@ type ListOperationResponse struct { } type ListCompleteResult struct { - Items []Registry + LatestHttpResponse *http.Response + Items []Registry } // List ... @@ -84,7 +85,8 @@ func (c RegistriesClient) ListCompleteMatchingPredicate(ctx context.Context, id } result = ListCompleteResult{ - Items: items, + LatestHttpResponse: resp.HttpResponse, + Items: items, } return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listbyresourcegroup.go index e716ed49cfbd..81be607d690d 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listbyresourcegroup.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listbyresourcegroup.go @@ -20,7 +20,8 @@ type ListByResourceGroupOperationResponse struct { } type ListByResourceGroupCompleteResult struct { - Items []Registry + LatestHttpResponse *http.Response + Items []Registry } // ListByResourceGroup ... @@ -84,7 +85,8 @@ func (c RegistriesClient) ListByResourceGroupCompleteMatchingPredicate(ctx conte } result = ListByResourceGroupCompleteResult{ - Items: items, + LatestHttpResponse: resp.HttpResponse, + Items: items, } return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listcredentials.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listcredentials.go index b974a756cdae..cc5f3f64da15 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listcredentials.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listcredentials.go @@ -44,7 +44,10 @@ func (c RegistriesClient) ListCredentials(ctx context.Context, id RegistryId) (r return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model RegistryListCredentialsResult + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listprivatelinkresources.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listprivatelinkresources.go index 088683b23a17..93dd60b9c6ff 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listprivatelinkresources.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listprivatelinkresources.go @@ -19,7 +19,8 @@ type ListPrivateLinkResourcesOperationResponse struct { } type ListPrivateLinkResourcesCompleteResult struct { - Items []PrivateLinkResource + LatestHttpResponse *http.Response + Items []PrivateLinkResource } // ListPrivateLinkResources ... @@ -83,7 +84,8 @@ func (c RegistriesClient) ListPrivateLinkResourcesCompleteMatchingPredicate(ctx } result = ListPrivateLinkResourcesCompleteResult{ - Items: items, + LatestHttpResponse: resp.HttpResponse, + Items: items, } return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listusages.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listusages.go index 7c8cddeacb6b..6a981aee2670 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listusages.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listusages.go @@ -44,7 +44,10 @@ func (c RegistriesClient) ListUsages(ctx context.Context, id RegistryId) (result return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model RegistryUsageListResult + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_regeneratecredential.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_regeneratecredential.go index c45dbc8e3a9a..4db46fb579bc 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_regeneratecredential.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_regeneratecredential.go @@ -48,7 +48,10 @@ func (c RegistriesClient) RegenerateCredential(ctx context.Context, id RegistryI return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model RegistryListCredentialsResult + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_update.go index 990dce091522..61af909a492b 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_update.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_update.go @@ -18,6 +18,7 @@ type UpdateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *Registry } // Update ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_registry.go index 457ec9c52f5b..5aa993ef70cd 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_registry.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_registry.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = RegistryId{} +func init() { + recaser.RegisterResourceId(&RegistryId{}) +} + +var _ resourceids.ResourceId = &RegistryId{} // RegistryId is a struct representing the Resource ID for a Registry type RegistryId struct { @@ -30,25 +35,15 @@ func NewRegistryID(subscriptionId string, resourceGroupName string, registryName // ParseRegistryID parses 'input' into a RegistryId func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -57,28 +52,36 @@ func ParseRegistryID(input string) (*RegistryId, error) { // ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId // note: this method should only be used for API response data and not user input func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { + var ok bool - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - return &id, nil + return nil } // ValidateRegistryID checks that 'input' can be parsed as a Registry ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_replication.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_replication.go index 6402b1649eda..604cae9aead2 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_replication.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_replication.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = ReplicationId{} +func init() { + recaser.RegisterResourceId(&ReplicationId{}) +} + +var _ resourceids.ResourceId = &ReplicationId{} // ReplicationId is a struct representing the Resource ID for a Replication type ReplicationId struct { @@ -32,29 +37,15 @@ func NewReplicationID(subscriptionId string, resourceGroupName string, registryN // ParseReplicationID parses 'input' into a ReplicationId func ParseReplicationID(input string) (*ReplicationId, error) { - parser := resourceids.NewParserFromResourceIdType(ReplicationId{}) + parser := resourceids.NewParserFromResourceIdType(&ReplicationId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := ReplicationId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) - } - - if id.ReplicationName, ok = parsed.Parsed["replicationName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "replicationName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -63,32 +54,40 @@ func ParseReplicationID(input string) (*ReplicationId, error) { // ParseReplicationIDInsensitively parses 'input' case-insensitively into a ReplicationId // note: this method should only be used for API response data and not user input func ParseReplicationIDInsensitively(input string) (*ReplicationId, error) { - parser := resourceids.NewParserFromResourceIdType(ReplicationId{}) + parser := resourceids.NewParserFromResourceIdType(&ReplicationId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := ReplicationId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + return &id, nil +} + +func (id *ReplicationId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - if id.ReplicationName, ok = parsed.Parsed["replicationName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "replicationName", *parsed) + if id.ReplicationName, ok = input.Parsed["replicationName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "replicationName", input) } - return &id, nil + return nil } // ValidateReplicationID checks that 'input' can be parsed as a Replication ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_create.go index 579af9a99362..f591043caae1 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_create.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_create.go @@ -18,6 +18,7 @@ type CreateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *Replication } // Create ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_get.go index f76e9bbc07c0..13be12c7ca15 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_get.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_get.go @@ -43,7 +43,10 @@ func (c ReplicationsClient) Get(ctx context.Context, id ReplicationId) (result G return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model Replication + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_list.go index 2dfadca7f8c0..d1c02bf7ce85 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_list.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_list.go @@ -19,7 +19,8 @@ type ListOperationResponse struct { } type ListCompleteResult struct { - Items []Replication + LatestHttpResponse *http.Response + Items []Replication } // List ... @@ -83,7 +84,8 @@ func (c ReplicationsClient) ListCompleteMatchingPredicate(ctx context.Context, i } result = ListCompleteResult{ - Items: items, + LatestHttpResponse: resp.HttpResponse, + Items: items, } return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_update.go index 2ebad5b39c10..329dc24b1632 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_update.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_update.go @@ -18,6 +18,7 @@ type UpdateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *Replication } // Update ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_registry.go index 1967fbf250a4..185bfc9501d1 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_registry.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_registry.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = RegistryId{} +func init() { + recaser.RegisterResourceId(&RegistryId{}) +} + +var _ resourceids.ResourceId = &RegistryId{} // RegistryId is a struct representing the Resource ID for a Registry type RegistryId struct { @@ -30,25 +35,15 @@ func NewRegistryID(subscriptionId string, resourceGroupName string, registryName // ParseRegistryID parses 'input' into a RegistryId func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -57,28 +52,36 @@ func ParseRegistryID(input string) (*RegistryId, error) { // ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId // note: this method should only be used for API response data and not user input func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { + var ok bool - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - return &id, nil + return nil } // ValidateRegistryID checks that 'input' can be parsed as a Registry ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_scopemap.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_scopemap.go index 1286cbbb29e9..f70441f715a7 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_scopemap.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_scopemap.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = ScopeMapId{} +func init() { + recaser.RegisterResourceId(&ScopeMapId{}) +} + +var _ resourceids.ResourceId = &ScopeMapId{} // ScopeMapId is a struct representing the Resource ID for a Scope Map type ScopeMapId struct { @@ -32,29 +37,15 @@ func NewScopeMapID(subscriptionId string, resourceGroupName string, registryName // ParseScopeMapID parses 'input' into a ScopeMapId func ParseScopeMapID(input string) (*ScopeMapId, error) { - parser := resourceids.NewParserFromResourceIdType(ScopeMapId{}) + parser := resourceids.NewParserFromResourceIdType(&ScopeMapId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := ScopeMapId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) - } - - if id.ScopeMapName, ok = parsed.Parsed["scopeMapName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "scopeMapName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -63,32 +54,40 @@ func ParseScopeMapID(input string) (*ScopeMapId, error) { // ParseScopeMapIDInsensitively parses 'input' case-insensitively into a ScopeMapId // note: this method should only be used for API response data and not user input func ParseScopeMapIDInsensitively(input string) (*ScopeMapId, error) { - parser := resourceids.NewParserFromResourceIdType(ScopeMapId{}) + parser := resourceids.NewParserFromResourceIdType(&ScopeMapId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := ScopeMapId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + return &id, nil +} + +func (id *ScopeMapId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - if id.ScopeMapName, ok = parsed.Parsed["scopeMapName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "scopeMapName", *parsed) + if id.ScopeMapName, ok = input.Parsed["scopeMapName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "scopeMapName", input) } - return &id, nil + return nil } // ValidateScopeMapID checks that 'input' can be parsed as a Scope Map ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_create.go index 815ad068f82d..d85a26ae4ccb 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_create.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_create.go @@ -18,6 +18,7 @@ type CreateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *ScopeMap } // Create ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_get.go index 6d4fcb00cb3a..48e684aa402e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_get.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_get.go @@ -43,7 +43,10 @@ func (c ScopeMapsClient) Get(ctx context.Context, id ScopeMapId) (result GetOper return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model ScopeMap + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_list.go index 9dc878a8646d..b27ad5219423 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_list.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_list.go @@ -19,7 +19,8 @@ type ListOperationResponse struct { } type ListCompleteResult struct { - Items []ScopeMap + LatestHttpResponse *http.Response + Items []ScopeMap } // List ... @@ -83,7 +84,8 @@ func (c ScopeMapsClient) ListCompleteMatchingPredicate(ctx context.Context, id R } result = ListCompleteResult{ - Items: items, + LatestHttpResponse: resp.HttpResponse, + Items: items, } return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_update.go index 4afaa88af831..5ca984a76ad1 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_update.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_update.go @@ -18,6 +18,7 @@ type UpdateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *ScopeMap } // Update ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_registry.go index 4c7ee22e373c..fda07a2cc32d 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_registry.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_registry.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = RegistryId{} +func init() { + recaser.RegisterResourceId(&RegistryId{}) +} + +var _ resourceids.ResourceId = &RegistryId{} // RegistryId is a struct representing the Resource ID for a Registry type RegistryId struct { @@ -30,25 +35,15 @@ func NewRegistryID(subscriptionId string, resourceGroupName string, registryName // ParseRegistryID parses 'input' into a RegistryId func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -57,28 +52,36 @@ func ParseRegistryID(input string) (*RegistryId, error) { // ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId // note: this method should only be used for API response data and not user input func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { + var ok bool - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - return &id, nil + return nil } // ValidateRegistryID checks that 'input' can be parsed as a Registry ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_token.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_token.go index 6d8c7149e6c8..af095b01bde2 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_token.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_token.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = TokenId{} +func init() { + recaser.RegisterResourceId(&TokenId{}) +} + +var _ resourceids.ResourceId = &TokenId{} // TokenId is a struct representing the Resource ID for a Token type TokenId struct { @@ -32,29 +37,15 @@ func NewTokenID(subscriptionId string, resourceGroupName string, registryName st // ParseTokenID parses 'input' into a TokenId func ParseTokenID(input string) (*TokenId, error) { - parser := resourceids.NewParserFromResourceIdType(TokenId{}) + parser := resourceids.NewParserFromResourceIdType(&TokenId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := TokenId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) - } - - if id.TokenName, ok = parsed.Parsed["tokenName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "tokenName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -63,32 +54,40 @@ func ParseTokenID(input string) (*TokenId, error) { // ParseTokenIDInsensitively parses 'input' case-insensitively into a TokenId // note: this method should only be used for API response data and not user input func ParseTokenIDInsensitively(input string) (*TokenId, error) { - parser := resourceids.NewParserFromResourceIdType(TokenId{}) + parser := resourceids.NewParserFromResourceIdType(&TokenId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := TokenId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + return &id, nil +} + +func (id *TokenId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - if id.TokenName, ok = parsed.Parsed["tokenName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "tokenName", *parsed) + if id.TokenName, ok = input.Parsed["tokenName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "tokenName", input) } - return &id, nil + return nil } // ValidateTokenID checks that 'input' can be parsed as a Token ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_create.go index 53aa1338a631..acafb7916a61 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_create.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_create.go @@ -18,6 +18,7 @@ type CreateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *Token } // Create ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_get.go index 59133098fccb..d7c6df407ba8 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_get.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_get.go @@ -43,7 +43,10 @@ func (c TokensClient) Get(ctx context.Context, id TokenId) (result GetOperationR return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model Token + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_list.go index 79b326ea831f..3fcd9ecad729 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_list.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_list.go @@ -19,7 +19,8 @@ type ListOperationResponse struct { } type ListCompleteResult struct { - Items []Token + LatestHttpResponse *http.Response + Items []Token } // List ... @@ -83,7 +84,8 @@ func (c TokensClient) ListCompleteMatchingPredicate(ctx context.Context, id Regi } result = ListCompleteResult{ - Items: items, + LatestHttpResponse: resp.HttpResponse, + Items: items, } return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_update.go index 44be7e22ae12..a6865eadc35e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_update.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_update.go @@ -18,6 +18,7 @@ type UpdateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *Token } // Update ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_registry.go index 6a0695fe81df..c878a6063dc6 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_registry.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_registry.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = RegistryId{} +func init() { + recaser.RegisterResourceId(&RegistryId{}) +} + +var _ resourceids.ResourceId = &RegistryId{} // RegistryId is a struct representing the Resource ID for a Registry type RegistryId struct { @@ -30,25 +35,15 @@ func NewRegistryID(subscriptionId string, resourceGroupName string, registryName // ParseRegistryID parses 'input' into a RegistryId func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -57,28 +52,36 @@ func ParseRegistryID(input string) (*RegistryId, error) { // ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId // note: this method should only be used for API response data and not user input func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(RegistryId{}) + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := RegistryId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { + var ok bool - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - return &id, nil + return nil } // ValidateRegistryID checks that 'input' can be parsed as a Registry ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go index 9764cd18a8c2..72e5710069e4 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go @@ -4,13 +4,18 @@ import ( "fmt" "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = WebHookId{} +func init() { + recaser.RegisterResourceId(&WebHookId{}) +} + +var _ resourceids.ResourceId = &WebHookId{} // WebHookId is a struct representing the Resource ID for a Web Hook type WebHookId struct { @@ -32,29 +37,15 @@ func NewWebHookID(subscriptionId string, resourceGroupName string, registryName // ParseWebHookID parses 'input' into a WebHookId func ParseWebHookID(input string) (*WebHookId, error) { - parser := resourceids.NewParserFromResourceIdType(WebHookId{}) + parser := resourceids.NewParserFromResourceIdType(&WebHookId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := WebHookId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) - } - - if id.WebHookName, ok = parsed.Parsed["webHookName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "webHookName", *parsed) + if err := id.FromParseResult(*parsed); err != nil { + return nil, err } return &id, nil @@ -63,32 +54,40 @@ func ParseWebHookID(input string) (*WebHookId, error) { // ParseWebHookIDInsensitively parses 'input' case-insensitively into a WebHookId // note: this method should only be used for API response data and not user input func ParseWebHookIDInsensitively(input string) (*WebHookId, error) { - parser := resourceids.NewParserFromResourceIdType(WebHookId{}) + parser := resourceids.NewParserFromResourceIdType(&WebHookId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - var ok bool id := WebHookId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + return &id, nil +} + +func (id *WebHookId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.RegistryName, ok = parsed.Parsed["registryName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "registryName", *parsed) + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) } - if id.WebHookName, ok = parsed.Parsed["webHookName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "webHookName", *parsed) + if id.WebHookName, ok = input.Parsed["webHookName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "webHookName", input) } - return &id, nil + return nil } // ValidateWebHookID checks that 'input' can be parsed as a Web Hook ID diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_create.go index 99d65964fc61..03efa380344f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_create.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_create.go @@ -18,6 +18,7 @@ type CreateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *Webhook } // Create ... diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_get.go index f604742236ab..e89ea9db5db2 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_get.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_get.go @@ -43,7 +43,10 @@ func (c WebHooksClient) Get(ctx context.Context, id WebHookId) (result GetOperat return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model Webhook + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_getcallbackconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_getcallbackconfig.go index 583205eafcee..17146c00e680 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_getcallbackconfig.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_getcallbackconfig.go @@ -44,7 +44,10 @@ func (c WebHooksClient) GetCallbackConfig(ctx context.Context, id WebHookId) (re return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model CallbackConfig + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_list.go index ee92f466e63c..4435c866b302 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_list.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_list.go @@ -19,7 +19,8 @@ type ListOperationResponse struct { } type ListCompleteResult struct { - Items []Webhook + LatestHttpResponse *http.Response + Items []Webhook } // List ... @@ -83,7 +84,8 @@ func (c WebHooksClient) ListCompleteMatchingPredicate(ctx context.Context, id Re } result = ListCompleteResult{ - Items: items, + LatestHttpResponse: resp.HttpResponse, + Items: items, } return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_listevents.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_listevents.go index 47fc1411814c..401daa1e86f0 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_listevents.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_listevents.go @@ -19,7 +19,8 @@ type ListEventsOperationResponse struct { } type ListEventsCompleteResult struct { - Items []Event + LatestHttpResponse *http.Response + Items []Event } // ListEvents ... @@ -83,7 +84,8 @@ func (c WebHooksClient) ListEventsCompleteMatchingPredicate(ctx context.Context, } result = ListEventsCompleteResult{ - Items: items, + LatestHttpResponse: resp.HttpResponse, + Items: items, } return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_ping.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_ping.go index d98a8fe33039..04e4ef1fde73 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_ping.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_ping.go @@ -44,7 +44,10 @@ func (c WebHooksClient) Ping(ctx context.Context, id WebHookId) (result PingOper return } - if err = resp.Unmarshal(&result.Model); err != nil { + var model EventInfo + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_update.go index c64f7501d196..99522fc1d577 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_update.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_update.go @@ -18,6 +18,7 @@ type UpdateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData + Model *Webhook } // Update ... From 4d6bf920a9303a029e0d959085000c85cbea2b7c Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Mon, 20 May 2024 16:01:57 -0400 Subject: [PATCH 11/74] remove unnecessary test --- ...ainer_registry_cache_rule_resource_test.go | 64 ------------------- 1 file changed, 64 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource_test.go b/internal/services/containers/container_registry_cache_rule_resource_test.go index 17871e79d0e3..2a149bf1599e 100644 --- a/internal/services/containers/container_registry_cache_rule_resource_test.go +++ b/internal/services/containers/container_registry_cache_rule_resource_test.go @@ -16,70 +16,6 @@ import ( type ContainerRegistryCacheRuleResource struct{} -func TestAccContainerRegistryCacheRuleName_validation(t *testing.T) { - cases := []struct { - Value string - ErrCount int - }{ - { - Value: "", - ErrCount: 2, - }, - { - Value: "four", - ErrCount: 1, - }, - { - Value: "5five", - ErrCount: 0, - }, - { - Value: "hello-world", - ErrCount: 0, - }, - { - Value: "hello-world-foo-bar-12345", - ErrCount: 0, - }, - { - Value: "hello_world", - ErrCount: 1, - }, - { - Value: "helloWorld", - ErrCount: 0, - }, - { - Value: "helloworld12", - ErrCount: 0, - }, - { - Value: "hello@world", - ErrCount: 1, - }, - { - Value: "qfvbdsbvipqdbwsbddbdcwqffewsqwcdw21ddwqwd3324120", - ErrCount: 0, - }, - { - Value: "qfvbdsbvipqdbwsbddbdcwqffewsqwcdw21ddwqwd33241202", - ErrCount: 0, - }, - { - Value: "qfvbdsbvipqdbwsbddbdcwqfjjfewsqwcdw21ddwqwd3324120", - ErrCount: 1, - }, - } - - for _, tc := range cases { - _, errors := validate.ContainerRegistryCacheRuleName(tc.Value, "azurerm_container_registry_cache_rule") - - if len(errors) != tc.ErrCount { - t.Fatalf("Expected the Azure RM Container Registry Cache Rule Name to trigger a validation error: %v", errors) - } - } -} - func TestAccContainerRegistryCacheRule_basic(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_container_registry_cache_rule", "test") r := ContainerRegistryCacheRuleResource{} From 60fe2464984ff0a4961a2e67e6536ba77888a494 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Mon, 20 May 2024 16:06:27 -0400 Subject: [PATCH 12/74] feat: use container_registry_id as arg --- .../containers/container_registry_cache_rule_resource.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index e506b6bd30d5..2536bc7782dc 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -30,14 +30,12 @@ func (ContainerRegistryCacheRule) Arguments() map[string]*pluginsdk.Schema { Required: true, Description: "The name of the cache rule.", }, - - "registry": { + "container_registry_id": { Type: pluginsdk.TypeString, Required: true, - Description: "The name of the container registry.", - ValidateFunc: containerValidate.ContainerRegistryName, + ForceNew: true, + ValidateFunc: registries.ValidateRegistryID, }, - "source_repo": { Type: pluginsdk.TypeString, Required: true, From be8ecd51f63864f0c5aa512e75eef55443e4f5f7 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Mon, 20 May 2024 16:08:12 -0400 Subject: [PATCH 13/74] feat: return cacherules --- .../containers/container_registry_cache_rule_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 2536bc7782dc..fbfc5b5d890a 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -210,5 +210,5 @@ func (ContainerRegistryCacheRule) Delete() sdk.ResourceFunc { } func (ContainerRegistryCacheRule) IDValidationFunc() pluginsdk.SchemaValidateFunc { - return validate.ContainerRegistryCacheRuleID + return cacherules.ValidateCacheRuleID } From 8a93ba338c9a76cbe926dda2c085d52d6ef4165f Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Mon, 20 May 2024 16:39:40 -0400 Subject: [PATCH 14/74] fix: formatting --- .../containers/container_registry_cache_rule_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index fbfc5b5d890a..091fb9be76b5 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -210,5 +210,5 @@ func (ContainerRegistryCacheRule) Delete() sdk.ResourceFunc { } func (ContainerRegistryCacheRule) IDValidationFunc() pluginsdk.SchemaValidateFunc { - return cacherules.ValidateCacheRuleID + return cacherules.ValidateCacheRuleID } From 876320e77269c6cde8057a30cdba8fbde9052399 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Mon, 20 May 2024 17:19:50 -0400 Subject: [PATCH 15/74] fix: test and deps --- internal/services/containers/client/client.go | 8 -------- .../container_registry_cache_rule_resource.go | 3 +-- .../container_registry_cache_rule_resource_test.go | 10 ++++------ 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/internal/services/containers/client/client.go b/internal/services/containers/client/client.go index ee34f10823b5..aa7a7471cab8 100644 --- a/internal/services/containers/client/client.go +++ b/internal/services/containers/client/client.go @@ -10,7 +10,6 @@ import ( containerregistry_v2019_06_01_preview "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2019-06-01-preview" containerregistry_v2021_08_01_preview "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview" containerregistry_v2023_07_01 "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2019-08-01/containerservices" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-09-02-preview/agentpools" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-09-02-preview/maintenanceconfigurations" @@ -64,13 +63,6 @@ func NewContainersClient(o *common.ClientOptions) (*Client, error) { return nil, err } - containerRegistryClient_v2023_07_01, err := containerregistry_v2023_07_01.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) { - o.Configure(c, o.Authorizers.ResourceManager) - }) - if err != nil { - return nil, err - } - // AKS fleetUpdateRunsClient, err := updateruns.NewUpdateRunsClientWithBaseURI(o.Environment.ResourceManager) if err != nil { diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 091fb9be76b5..11c4595faeac 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -10,11 +10,10 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/registries" "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" - containerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" ) diff --git a/internal/services/containers/container_registry_cache_rule_resource_test.go b/internal/services/containers/container_registry_cache_rule_resource_test.go index 2a149bf1599e..fa2b7c46d412 100644 --- a/internal/services/containers/container_registry_cache_rule_resource_test.go +++ b/internal/services/containers/container_registry_cache_rule_resource_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -82,11 +81,10 @@ resource "azurerm_container_registry" "test" { } resource "azurerm_container_registry_cache_rule" "test" { - name = "testacc-cr-cache-rule-%d" - resource_group_name = azurerm_resource_group.test.name - registry = azurerm_container_registry.test.name - target_repo = "target" - source_repo = "docker.io/hello-world" + name = "testacc-cr-cache-rule-%d" + container_registry_id = azurerm_container_registry.test.name + target_repo = "target" + source_repo = "docker.io/hello-world" } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) } From b0718b1159c1fe72b0043dcc002ce9aabd4f8c4b Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Mon, 20 May 2024 18:17:18 -0400 Subject: [PATCH 16/74] more test fixes --- internal/services/containers/client/client.go | 8 +++++ .../container_registry_cache_rule_resource.go | 32 ++++++++++++++++--- ...ainer_registry_cache_rule_resource_test.go | 8 +++-- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/internal/services/containers/client/client.go b/internal/services/containers/client/client.go index aa7a7471cab8..ebbff1b937c2 100644 --- a/internal/services/containers/client/client.go +++ b/internal/services/containers/client/client.go @@ -63,6 +63,13 @@ func NewContainersClient(o *common.ClientOptions) (*Client, error) { return nil, err } + containerRegistryClient_v2023_07_01, err := containerregistry_v2023_07_01.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) { + o.Configure(c, o.Authorizers.ResourceManager) + }) + if err != nil { + return nil, err + } + // AKS fleetUpdateRunsClient, err := updateruns.NewUpdateRunsClientWithBaseURI(o.Environment.ResourceManager) if err != nil { @@ -121,6 +128,7 @@ func NewContainersClient(o *common.ClientOptions) (*Client, error) { return &Client{ AgentPoolsClient: agentPoolsClient, ContainerInstanceClient: containerInstanceClient, + ContainerRegistryClient_v2023_07_01: containerRegistryClient_v2023_07_01, ContainerRegistryClient_v2021_08_01_preview: containerRegistryClient_v2021_08_01_preview, ContainerRegistryClient_v2019_06_01_preview: containerRegistryClient_v2019_06_01_preview, FleetUpdateRunsClient: fleetUpdateRunsClient, diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 11c4595faeac..d560dc40a5bc 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -7,6 +7,7 @@ import ( "context" "fmt" "log" + "strings" "time" "github.com/hashicorp/go-azure-helpers/lang/response" @@ -72,9 +73,27 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { defer cancel() log.Printf("[INFO] preparing arguments for Container Registry Cache Rule creation.") + registryId := metadata.ResourceData.Get("container_registry_id").(string) + + // Split the registryId into its components + parts := strings.Split(registryId, "/") + + // Initialize variables for resource group and registry name + var resourceGroup, registryName string + + // Iterate through the parts and find the resource group and registry name + for i, part := range parts { + if part == "resourceGroups" && i+1 < len(parts) { + resourceGroup = parts[i+1] + } + if part == "registries" && i+1 < len(parts) { + registryName = parts[i+1] + } + } + id := cacherules.NewCacheRuleID(subscriptionId, - metadata.ResourceData.Get("resource_group_name").(string), - metadata.ResourceData.Get("registry").(string), + resourceGroup, + registryName, metadata.ResourceData.Get("name").(string), ) @@ -130,6 +149,12 @@ func (ContainerRegistryCacheRule) Read() sdk.ResourceFunc { return err } + subscriptionId := metadata.Client.Account.SubscriptionId + resourceGroupName := id.ResourceGroupName + registryName := id.RegistryName + + registryId := registries.NewRegistryID(subscriptionId, resourceGroupName, registryName) + resp, err := cacheRulesClient.Get(ctx, *id) if err != nil { if response.WasNotFound(resp.HttpResponse) { @@ -141,7 +166,7 @@ func (ContainerRegistryCacheRule) Read() sdk.ResourceFunc { } metadata.ResourceData.Set("name", id.CacheRuleName) - metadata.ResourceData.Set("registry", id.RegistryName) + metadata.ResourceData.Set("container_registry_id", registryId.ID()) if model := resp.Model; model != nil { if properties := model.Properties; properties != nil { @@ -169,7 +194,6 @@ func (r ContainerRegistryCacheRule) Update() sdk.ResourceFunc { if err != nil { return err } - // TODO: You can only update the credential set. To be implemented parameters := cacherules.CacheRuleUpdateParameters{ Properties: &cacherules.CacheRuleUpdateProperties{}, diff --git a/internal/services/containers/container_registry_cache_rule_resource_test.go b/internal/services/containers/container_registry_cache_rule_resource_test.go index fa2b7c46d412..22979fcfc4dd 100644 --- a/internal/services/containers/container_registry_cache_rule_resource_test.go +++ b/internal/services/containers/container_registry_cache_rule_resource_test.go @@ -82,7 +82,7 @@ resource "azurerm_container_registry" "test" { resource "azurerm_container_registry_cache_rule" "test" { name = "testacc-cr-cache-rule-%d" - container_registry_id = azurerm_container_registry.test.name + container_registry_id = azurerm_container_registry.test.id target_repo = "target" source_repo = "docker.io/hello-world" } @@ -94,8 +94,10 @@ func (r ContainerRegistryCacheRuleResource) requiresImport(data acceptance.TestD %s resource "azurerm_container_registry_cache_rule" "import" { - name = azurerm_container_registry_cache_rule.test.name - resource_group_name = azurerm_container_registry_cache_rule.test.resource_group_name + name = azurerm_container_registry_cache_rule.test.name + container_registry_id = azurerm_container_registry_cache_rule.test.container_registry_id + target_repo = azurerm_container_registry_cache_rule.test.target_repo + source_repo = azurerm_container_registry_cache_rule.test.source_repo } `, r.basic(data)) } From 6bba7a24c442b26d5fda18bdc812f1e082936013 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Mon, 20 May 2024 18:26:36 -0400 Subject: [PATCH 17/74] feat: improve registry ID parsing for cache resource --- .../container_registry_cache_rule_resource.go | 23 +++++-------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index d560dc40a5bc..7145cef528bb 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -7,7 +7,6 @@ import ( "context" "fmt" "log" - "strings" "time" "github.com/hashicorp/go-azure-helpers/lang/response" @@ -73,24 +72,14 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { defer cancel() log.Printf("[INFO] preparing arguments for Container Registry Cache Rule creation.") - registryId := metadata.ResourceData.Get("container_registry_id").(string) - - // Split the registryId into its components - parts := strings.Split(registryId, "/") - - // Initialize variables for resource group and registry name - var resourceGroup, registryName string - - // Iterate through the parts and find the resource group and registry name - for i, part := range parts { - if part == "resourceGroups" && i+1 < len(parts) { - resourceGroup = parts[i+1] - } - if part == "registries" && i+1 < len(parts) { - registryName = parts[i+1] - } + registryId, err := registries.ParseRegistryID(metadata.ResourceData.Get("container_registry_id").(string)) + if err != nil { + return err } + resourceGroup := registryId.ResourceGroupName + registryName := registryId.RegistryName + id := cacherules.NewCacheRuleID(subscriptionId, resourceGroup, registryName, From 03e83193a28f582bf84bd21e70c3d130e254609a Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Mon, 20 May 2024 19:30:18 -0400 Subject: [PATCH 18/74] feat: add docs for cache rule resource --- ...ontainer_registry_cache_rule.html.markdown | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 website/docs/r/container_registry_cache_rule.html.markdown diff --git a/website/docs/r/container_registry_cache_rule.html.markdown b/website/docs/r/container_registry_cache_rule.html.markdown new file mode 100644 index 000000000000..4ff4a29132a3 --- /dev/null +++ b/website/docs/r/container_registry_cache_rule.html.markdown @@ -0,0 +1,75 @@ +--- +subcategory: "Container" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_container_registry_cache_rule" +description: |- + Manages an Azure Container Registry Cache Rule. + +--- + +# azurerm_container_registry + +Manages an Azure Container Registry. + +~> **Note:** All arguments including the access key will be stored in the raw state as plain-text. +[Read more about sensitive data in state](/docs/state/sensitive-data.html). + +## Example Usage + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_container_registry" "acr" { + name = "containerRegistry1" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location + sku = "Basic" +} + +resource "azurerm_container_cache_rule" "cache_rule" { + name = "cacherule" + container_registry_id = azurerm_container_registry.acr.id + target_repo = "target" + source_repo = "docker.io/hello-world" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Specifies the name of the Container Registry Cache Rule. Only Alphanumeric characters allowed. Changing this forces a new resource to be created. + +* `container_registry_id` - (Required) The ID of the container registry where the cache rule should apply. Changing this forces a new resource to be created. + +* `source_repo` - (Required) The name of the source repository path. Changing this forces a new resource to be created. + +* `target_repo` - (Required) The name of the new repository path to store artifacts. Changing this forces a new resource to be created. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Container Registry Cache Rule. + +--- + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the Container Registry. +* `update` - (Defaults to 30 minutes) Used when updating the Container Registry. +* `read` - (Defaults to 5 minutes) Used when retrieving the Container Registry. +* `delete` - (Defaults to 30 minutes) Used when deleting the Container Registry. + +## Import + +Container Registry cache rules can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_container_registry_cache_rule.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ContainerRegistry/registries/myregistry1 +``` From b23458ad4c741352b65c5e586ef4a6b61c2cd957 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Mon, 20 May 2024 19:36:08 -0400 Subject: [PATCH 19/74] fix: cache rule resource docs --- website/docs/r/container_registry_cache_rule.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/container_registry_cache_rule.html.markdown b/website/docs/r/container_registry_cache_rule.html.markdown index 4ff4a29132a3..476113c0e121 100644 --- a/website/docs/r/container_registry_cache_rule.html.markdown +++ b/website/docs/r/container_registry_cache_rule.html.markdown @@ -71,5 +71,5 @@ The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/l Container Registry cache rules can be imported using the `resource id`, e.g. ```shell -terraform import azurerm_container_registry_cache_rule.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ContainerRegistry/registries/myregistry1 +terraform import azurerm_container_registry_cache_rule.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule ``` From 4ef3cf72e2cc6ab5799a9f6b65bad8136993ba6f Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Mon, 20 May 2024 19:52:51 -0400 Subject: [PATCH 20/74] fix: typo --- website/docs/r/container_registry_cache_rule.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/container_registry_cache_rule.html.markdown b/website/docs/r/container_registry_cache_rule.html.markdown index 476113c0e121..bb92cbc3e3e4 100644 --- a/website/docs/r/container_registry_cache_rule.html.markdown +++ b/website/docs/r/container_registry_cache_rule.html.markdown @@ -29,7 +29,7 @@ resource "azurerm_container_registry" "acr" { sku = "Basic" } -resource "azurerm_container_cache_rule" "cache_rule" { +resource "azurerm_container_registry_cache_rule" "cache_rule" { name = "cacherule" container_registry_id = azurerm_container_registry.acr.id target_repo = "target" From 4cc51621ee22cbb2305c162d04c249b0cae3167c Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Mon, 20 May 2024 21:38:41 -0400 Subject: [PATCH 21/74] feat: add support for CredentialSetId --- .../container_registry_cache_rule_resource.go | 30 +++++++++++++++++-- ...ontainer_registry_cache_rule.html.markdown | 3 ++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 7145cef528bb..b2b08a629bd1 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -27,6 +27,7 @@ func (ContainerRegistryCacheRule) Arguments() map[string]*pluginsdk.Schema { "name": { Type: pluginsdk.TypeString, Required: true, + ForceNew: true, Description: "The name of the cache rule.", }, "container_registry_id": { @@ -35,15 +36,22 @@ func (ContainerRegistryCacheRule) Arguments() map[string]*pluginsdk.Schema { ForceNew: true, ValidateFunc: registries.ValidateRegistryID, }, + "credential_set_id": { + Type: pluginsdk.TypeString, + Optional: true, + Description: "The ARM resource ID of the credential store which is associated with the cache rule.", + }, "source_repo": { Type: pluginsdk.TypeString, Required: true, + ForceNew: true, Description: "The full source repository path such as 'docker.io/library/ubuntu'.", }, "target_repo": { Type: pluginsdk.TypeString, Required: true, + ForceNew: true, Description: "The target repository namespace such as 'ubuntu'.", }, } @@ -105,6 +113,8 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { // TODO: validate the source repo. sourceRepo := metadata.ResourceData.Get("source_repo").(string) + credentialSetId := metadata.ResourceData.Get("credential_set_id").(string) + parameters := cacherules.CacheRule{ Name: &id.CacheRuleName, Properties: &cacherules.CacheRuleProperties{ @@ -113,6 +123,11 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { }, } + // Conditionally add CredentialSetResourceId if credentialSetId is not empty + if credentialSetId != "" { + parameters.Properties.CredentialSetResourceId = &credentialSetId + } + if err := cacheRulesClient.CreateThenPoll(ctx, id, parameters); err != nil { return fmt.Errorf("creating Container Registry Cache Rule %s: %+v", id, err) } @@ -161,6 +176,7 @@ func (ContainerRegistryCacheRule) Read() sdk.ResourceFunc { if properties := model.Properties; properties != nil { metadata.ResourceData.Set("source_repo", properties.SourceRepository) metadata.ResourceData.Set("target_repo", properties.TargetRepository) + metadata.ResourceData.Set("credential_set_id", properties.CredentialSetResourceId) } } @@ -183,9 +199,17 @@ func (r ContainerRegistryCacheRule) Update() sdk.ResourceFunc { if err != nil { return err } - // TODO: You can only update the credential set. To be implemented - parameters := cacherules.CacheRuleUpdateParameters{ - Properties: &cacherules.CacheRuleUpdateProperties{}, + + parameters := cacherules.CacheRuleUpdateParameters{} + credentialSetId := metadata.ResourceData.Get("credential_set_id").(string) + + if credentialSetId != "" { + parameters = cacherules.CacheRuleUpdateParameters{ + Properties: &cacherules.CacheRuleUpdateProperties{CredentialSetResourceId: &credentialSetId}, + } + } else { + //This is due to an issue with the Azure CacheRule API that prevents removing credentials + return fmt.Errorf("Error on update: credential_set_id must not be empty: %s", id) } if err := cacheRulesClient.UpdateThenPoll(ctx, *id, parameters); err != nil { diff --git a/website/docs/r/container_registry_cache_rule.html.markdown b/website/docs/r/container_registry_cache_rule.html.markdown index bb92cbc3e3e4..b35a1425a622 100644 --- a/website/docs/r/container_registry_cache_rule.html.markdown +++ b/website/docs/r/container_registry_cache_rule.html.markdown @@ -34,6 +34,7 @@ resource "azurerm_container_registry_cache_rule" "cache_rule" { container_registry_id = azurerm_container_registry.acr.id target_repo = "target" source_repo = "docker.io/hello-world" + credential_set_id = "${azurerm_container_registry.id}/credentialSets/example" } ``` @@ -49,6 +50,8 @@ The following arguments are supported: * `target_repo` - (Required) The name of the new repository path to store artifacts. Changing this forces a new resource to be created. +* `credential_set_id` - (Optional) The ARM resource ID of the credential store which is associated with the cache rule. + ## Attributes Reference In addition to the Arguments listed above - the following Attributes are exported: From 670fafa76f546677bf0d21cd074df765ffe7c5c5 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Tue, 21 May 2024 11:22:54 -0400 Subject: [PATCH 22/74] fix: docs --- .../r/container_registry_cache_rule.html.markdown | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/website/docs/r/container_registry_cache_rule.html.markdown b/website/docs/r/container_registry_cache_rule.html.markdown index b35a1425a622..11a6c2aa4b95 100644 --- a/website/docs/r/container_registry_cache_rule.html.markdown +++ b/website/docs/r/container_registry_cache_rule.html.markdown @@ -7,9 +7,9 @@ description: |- --- -# azurerm_container_registry +# azurerm_container_registry_cache_rule -Manages an Azure Container Registry. +Manages an Azure Container Registry Cache Rule. ~> **Note:** All arguments including the access key will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). @@ -64,10 +64,10 @@ In addition to the Arguments listed above - the following Attributes are exporte The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: -* `create` - (Defaults to 30 minutes) Used when creating the Container Registry. -* `update` - (Defaults to 30 minutes) Used when updating the Container Registry. -* `read` - (Defaults to 5 minutes) Used when retrieving the Container Registry. -* `delete` - (Defaults to 30 minutes) Used when deleting the Container Registry. +* `create` - (Defaults to 30 minutes) Used when creating the Container Registry Cache Rule. +* `update` - (Defaults to 30 minutes) Used when updating the Container Registry Cache Rule. +* `read` - (Defaults to 5 minutes) Used when retrieving the Container Registry Cache Rule. +* `delete` - (Defaults to 30 minutes) Used when deleting the Container Registry Cache Rule. ## Import From 54e09e4a17b2b9f5282e6d3958f9dce7fa272af0 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Tue, 21 May 2024 15:15:49 -0400 Subject: [PATCH 23/74] feat: add container_registry_cache_rule data source, as well as name validation on the resource --- ...ntainer_registry_cache_rule_data_source.go | 103 ++++++++++++++++++ ...er_registry_cache_rule_data_source_test.go | 42 +++++++ .../container_registry_cache_rule_resource.go | 10 +- internal/services/containers/registration.go | 1 + 4 files changed, 152 insertions(+), 4 deletions(-) create mode 100644 internal/services/containers/container_registry_cache_rule_data_source.go create mode 100644 internal/services/containers/container_registry_cache_rule_data_source_test.go diff --git a/internal/services/containers/container_registry_cache_rule_data_source.go b/internal/services/containers/container_registry_cache_rule_data_source.go new file mode 100644 index 000000000000..e9f18eb54c3f --- /dev/null +++ b/internal/services/containers/container_registry_cache_rule_data_source.go @@ -0,0 +1,103 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package containers + +import ( + "context" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/registries" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" +) + +type ContainerRegistryCacheRuleDataSource struct{} + +func (ContainerRegistryCacheRuleDataSource) ResourceType() string { + return "azurerm_container_registry_cache_rule" +} + +func (ContainerRegistryCacheRuleDataSource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Containers.ContainerRegistryClient_v2023_07_01.CacheRules + subscriptionId := metadata.Client.Account.SubscriptionId + + containerRegistryId := metadata.ResourceData.Get("container_registry_id").(string) + registryId, err := registries.ParseRegistryID(containerRegistryId) + if err != nil { + return err + } + + id := cacherules.NewCacheRuleID(subscriptionId, registryId.ResourceGroupName, registryId.RegistryName, metadata.ResourceData.Get("name").(string)) + + resp, err := client.Get(ctx, id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + return fmt.Errorf("%s was not found", id) + } + + return fmt.Errorf("retrieving %s: %+v", id, err) + } + + metadata.SetID(id) + metadata.ResourceData.Set("name", id.CacheRuleName) + metadata.ResourceData.Set("container_registry_id", containerRegistryId) + + if model := resp.Model; model != nil { + if props := model.Properties; props != nil { + metadata.ResourceData.Set("source_repo", props.SourceRepository) + metadata.ResourceData.Set("target_repo", props.TargetRepository) + if props.CredentialSetResourceId != nil { + metadata.ResourceData.Set("credential_set_id", props.CredentialSetResourceId) + } + } + } + return nil + }, + } +} + +func (ContainerRegistryCacheRuleDataSource) ModelObject() interface{} { + return nil +} + +func (ContainerRegistryCacheRuleDataSource) Arguments() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validate.ContainerRegistryCacheRuleName, + }, + "container_registry_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: registries.ValidateRegistryID, + }, + } +} + +func (ContainerRegistryCacheRuleDataSource) Attributes() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "credential_set_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + "source_repo": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "target_repo": { + Type: pluginsdk.TypeString, + Computed: true, + }, + } +} diff --git a/internal/services/containers/container_registry_cache_rule_data_source_test.go b/internal/services/containers/container_registry_cache_rule_data_source_test.go new file mode 100644 index 000000000000..f20fb82e773c --- /dev/null +++ b/internal/services/containers/container_registry_cache_rule_data_source_test.go @@ -0,0 +1,42 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package containers_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type ContainerRegistryCacheRuleDataSource struct{} + +func TestAccDataSourceAzureRMContainerRegistryCacheRule_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_container_registry_cache_rule", "test") + r := ContainerRegistryCacheRuleDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists(), + check.That(data.ResourceName).Key("container_registry_id").Exists(), + check.That(data.ResourceName).Key("source_repo").Exists(), + check.That(data.ResourceName).Key("target_repo").Exists(), + ), + }, + }) +} + +func (ContainerRegistryCacheRuleDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +data "azurerm_container_registry_cache_rule" "test" { + name = azurerm_container_registry_cache_rule.test.name + container_registry_id = azurerm_container_registry_cache_rule.test.container_registry_id +} +`, ContainerRegistryCacheRuleResource{}.basic(data)) +} diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index b2b08a629bd1..ec72fac38da8 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" ) @@ -25,10 +26,11 @@ type ContainerRegistryCacheRule struct{} func (ContainerRegistryCacheRule) Arguments() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ "name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - Description: "The name of the cache rule.", + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + Description: "The name of the cache rule.", + ValidateFunc: validate.ContainerRegistryCacheRuleName, }, "container_registry_id": { Type: pluginsdk.TypeString, diff --git a/internal/services/containers/registration.go b/internal/services/containers/registration.go index 623bf277351f..32ff3d85aa5a 100644 --- a/internal/services/containers/registration.go +++ b/internal/services/containers/registration.go @@ -61,6 +61,7 @@ func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { func (r Registration) DataSources() []sdk.DataSource { dataSources := []sdk.DataSource{ KubernetesNodePoolSnapshotDataSource{}, + ContainerRegistryCacheRuleDataSource{}, } dataSources = append(dataSources, r.autoRegistration.DataSources()...) return dataSources From 3b19cabf4b74f09dc42a8eaa019237ae25cdeec2 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Tue, 21 May 2024 15:46:55 -0400 Subject: [PATCH 24/74] feat: add container_registry_cache_rule data source docs --- ...ontainer_registry_cache_rule.html.markdown | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 website/docs/d/container_registry_cache_rule.html.markdown diff --git a/website/docs/d/container_registry_cache_rule.html.markdown b/website/docs/d/container_registry_cache_rule.html.markdown new file mode 100644 index 000000000000..0bf7d6bfcd27 --- /dev/null +++ b/website/docs/d/container_registry_cache_rule.html.markdown @@ -0,0 +1,50 @@ +--- +subcategory: "Container" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_container_registry_cache_rule" +description: |- + Get information about an existing Container Registry Cache Rule + +--- + +# Data Source: azurerm_container_registry_cache_rule + +Use this data source to access information about an existing Container Registry Cache Rule. + +## Example Usage + +```hcl +data "azurerm_container_registry" "example" { + name = "testacr" + container_registry_id = "test" +} + +output "cache_rule_source_repo" { + value = data.azurerm_container_registry_cache_rule.example.source_repo +} +``` + +## Argument Reference + +* `name` - Specifies the name of the Container Registry Cache Rule. Only Alphanumeric characters allowed. Changing this forces a new resource to be created. + +* `container_registry_id` - The ID of the container registry where the cache rule should apply. Changing this forces a new resource to be created. + +## Attributes Reference + +The following attributes are exported: + +* `id` - The Container Registry ID. + +* `source_repo` - The name of the source repository path. + +* `target_repo` - The name of the new repository path to store artifacts. + +* `credential_set_id` - The ARM resource ID of the credential store which is associated with the cache rule. + + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the Container Registry. From 254299a7f094e9b7f24eca1b7097485124da1a2e Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Tue, 21 May 2024 16:07:35 -0400 Subject: [PATCH 25/74] fix: formatting --- website/docs/d/container_registry_cache_rule.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/d/container_registry_cache_rule.html.markdown b/website/docs/d/container_registry_cache_rule.html.markdown index 0bf7d6bfcd27..3b78641b9e46 100644 --- a/website/docs/d/container_registry_cache_rule.html.markdown +++ b/website/docs/d/container_registry_cache_rule.html.markdown @@ -15,7 +15,7 @@ Use this data source to access information about an existing Container Registry ```hcl data "azurerm_container_registry" "example" { - name = "testacr" + name = "testacr" container_registry_id = "test" } From 6a9980f8fbc93290a7202ab2dd5e3cd43a2bb9f2 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:41:05 -0400 Subject: [PATCH 26/74] Update internal/services/containers/client/client.go Co-authored-by: stephybun --- internal/services/containers/client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/client/client.go b/internal/services/containers/client/client.go index ebbff1b937c2..385d9728a723 100644 --- a/internal/services/containers/client/client.go +++ b/internal/services/containers/client/client.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2023-05-01/containerinstance" containerregistry_v2019_06_01_preview "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2019-06-01-preview" containerregistry_v2021_08_01_preview "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview" - containerregistry_v2023_07_01 "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2019-08-01/containerservices" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-09-02-preview/agentpools" "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-09-02-preview/maintenanceconfigurations" From 5bda93408179a82a205bf828213000590e8b8d10 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:41:19 -0400 Subject: [PATCH 27/74] Update internal/services/containers/client/client.go Co-authored-by: stephybun --- internal/services/containers/client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/client/client.go b/internal/services/containers/client/client.go index 385d9728a723..a17e38e5721f 100644 --- a/internal/services/containers/client/client.go +++ b/internal/services/containers/client/client.go @@ -27,7 +27,7 @@ import ( type Client struct { AgentPoolsClient *agentpools.AgentPoolsClient ContainerInstanceClient *containerinstance.ContainerInstanceClient - ContainerRegistryClient_v2023_07_01 *containerregistry_v2023_07_01.Client + CacheRulesClient *cacherules.CacheRulesClient ContainerRegistryClient_v2021_08_01_preview *containerregistry_v2021_08_01_preview.Client // v2019_06_01_preview is needed for container registry agent pools and tasks ContainerRegistryClient_v2019_06_01_preview *containerregistry_v2019_06_01_preview.Client From 04a24a2c86a5e69f9a955a7347e681b54253869b Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:41:39 -0400 Subject: [PATCH 28/74] Update internal/services/containers/client/client.go Co-authored-by: stephybun --- internal/services/containers/client/client.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/services/containers/client/client.go b/internal/services/containers/client/client.go index a17e38e5721f..25cf791aef8c 100644 --- a/internal/services/containers/client/client.go +++ b/internal/services/containers/client/client.go @@ -63,12 +63,11 @@ func NewContainersClient(o *common.ClientOptions) (*Client, error) { return nil, err } - containerRegistryClient_v2023_07_01, err := containerregistry_v2023_07_01.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) { - o.Configure(c, o.Authorizers.ResourceManager) - }) +cacheRulesClient, err := cacherules.NewCacheRulesClientWithBaseURI(o.Environment.ResourceManager) if err != nil { - return nil, err + return nil, fmt.Errorf("building Cache Rules client: %+v", err) } + o.Configure(cacheRulesClient.Client, o.Authorizers.ResourceManager) // AKS fleetUpdateRunsClient, err := updateruns.NewUpdateRunsClientWithBaseURI(o.Environment.ResourceManager) From 838cd6979c50e7651d0ca8b03a5c5aa2f40ded27 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:41:47 -0400 Subject: [PATCH 29/74] Update internal/services/containers/client/client.go Co-authored-by: stephybun --- internal/services/containers/client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/client/client.go b/internal/services/containers/client/client.go index 25cf791aef8c..1a46b6eae409 100644 --- a/internal/services/containers/client/client.go +++ b/internal/services/containers/client/client.go @@ -127,7 +127,7 @@ cacheRulesClient, err := cacherules.NewCacheRulesClientWithBaseURI(o.Environment return &Client{ AgentPoolsClient: agentPoolsClient, ContainerInstanceClient: containerInstanceClient, - ContainerRegistryClient_v2023_07_01: containerRegistryClient_v2023_07_01, + CacheRulesClient: cacheRulesClient, ContainerRegistryClient_v2021_08_01_preview: containerRegistryClient_v2021_08_01_preview, ContainerRegistryClient_v2019_06_01_preview: containerRegistryClient_v2019_06_01_preview, FleetUpdateRunsClient: fleetUpdateRunsClient, From 62b94ff7f0dddc1ce06a374f208baf7bf85e84e9 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:41:55 -0400 Subject: [PATCH 30/74] Update internal/services/containers/container_registry_cache_rule_data_source.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_data_source.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_data_source.go b/internal/services/containers/container_registry_cache_rule_data_source.go index e9f18eb54c3f..c89618d893a1 100644 --- a/internal/services/containers/container_registry_cache_rule_data_source.go +++ b/internal/services/containers/container_registry_cache_rule_data_source.go @@ -27,7 +27,7 @@ func (ContainerRegistryCacheRuleDataSource) Read() sdk.ResourceFunc { Timeout: 5 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - client := metadata.Client.Containers.ContainerRegistryClient_v2023_07_01.CacheRules + client := metadata.Client.Containers.CacheRulesClient subscriptionId := metadata.Client.Account.SubscriptionId containerRegistryId := metadata.ResourceData.Get("container_registry_id").(string) From eac13e8b3e7050d4ba4cc857ba56fb38182a9fbc Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:42:04 -0400 Subject: [PATCH 31/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index ec72fac38da8..0037db465b5a 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -229,7 +229,7 @@ func (ContainerRegistryCacheRule) Delete() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - cacheRulesClient := metadata.Client.Containers.ContainerRegistryClient_v2023_07_01.CacheRules + cacheRulesClient := metadata.Client.Containers.CacheRulesClient ctx, cancel := timeouts.ForDelete(metadata.Client.StopContext, metadata.ResourceData) defer cancel() From aa880f541a695d3c31b36c689289865a0a994688 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:42:11 -0400 Subject: [PATCH 32/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 0037db465b5a..0773f24c7eae 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -191,7 +191,7 @@ func (r ContainerRegistryCacheRule) Update() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - cacheRulesClient := metadata.Client.Containers.ContainerRegistryClient_v2023_07_01.CacheRules + cacheRulesClient := metadata.Client.Containers.CacheRulesClient ctx, cancel := timeouts.ForRead(metadata.Client.StopContext, metadata.ResourceData) defer cancel() From 81ad620aa76293c92fe54d8907e0f13ab24ed52f Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:42:29 -0400 Subject: [PATCH 33/74] Update internal/services/containers/resourceids.go Co-authored-by: stephybun --- internal/services/containers/resourceids.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/services/containers/resourceids.go b/internal/services/containers/resourceids.go index 519da777ec49..3a48ea7ec943 100644 --- a/internal/services/containers/resourceids.go +++ b/internal/services/containers/resourceids.go @@ -5,6 +5,5 @@ package containers //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=Cluster -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=NodePool -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool1 -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=ContainerRegistryCacheRule -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/cacheRules/rule1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=ContainerRegistryTaskSchedule -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/tasks/task1/schedule/schedule1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=ContainerRegistryTokenPassword -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.ContainerRegistry/registries/registry1/tokens/token1/passwords/password From d92a8777184e5552c6c9a2bfe8606b90e92383c3 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:43:00 -0400 Subject: [PATCH 34/74] Update internal/services/containers/container_registry_cache_rule_data_source.go Co-authored-by: stephybun --- .../container_registry_cache_rule_data_source.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_data_source.go b/internal/services/containers/container_registry_cache_rule_data_source.go index c89618d893a1..43784199c821 100644 --- a/internal/services/containers/container_registry_cache_rule_data_source.go +++ b/internal/services/containers/container_registry_cache_rule_data_source.go @@ -65,8 +65,16 @@ func (ContainerRegistryCacheRuleDataSource) Read() sdk.ResourceFunc { } } +type ContainerRegistryCacheRuleDataSourceModel struct { + Name string `tfschema:"name"` + ContainerRegistryId string `tfschema:"container_registry_id"` + CredentialSetId string `tfschema:"credential_set_id"` + SourceRepo string `tfschema:"source_repo"` + TargetRepo string `tfschema:"target_repo"` +} + func (ContainerRegistryCacheRuleDataSource) ModelObject() interface{} { - return nil + return &ContainerRegistryCacheRuleDataSourceModel{} } func (ContainerRegistryCacheRuleDataSource) Arguments() map[string]*pluginsdk.Schema { From c1b0667b38eb8c58ae54ded27171ef0dfb7899ab Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:43:28 -0400 Subject: [PATCH 35/74] Update internal/services/containers/container_registry_cache_rule_resource_test.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource_test.go b/internal/services/containers/container_registry_cache_rule_resource_test.go index 22979fcfc4dd..a48c0a5e0744 100644 --- a/internal/services/containers/container_registry_cache_rule_resource_test.go +++ b/internal/services/containers/container_registry_cache_rule_resource_test.go @@ -54,7 +54,7 @@ func (t ContainerRegistryCacheRuleResource) Exists(ctx context.Context, clients return nil, err } - resp, err := clients.Containers.ContainerRegistryClient_v2023_07_01.CacheRules.Get(ctx, *id) + resp, err := clients.Containers.CacheRulesClient.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %+v", id, err) } From 8fe8f9e173b6bb3cf875e15ec4397b38bb574463 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:44:05 -0400 Subject: [PATCH 36/74] Update internal/services/containers/container_registry_cache_rule_data_source.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_data_source.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/services/containers/container_registry_cache_rule_data_source.go b/internal/services/containers/container_registry_cache_rule_data_source.go index 43784199c821..08ae8747d78f 100644 --- a/internal/services/containers/container_registry_cache_rule_data_source.go +++ b/internal/services/containers/container_registry_cache_rule_data_source.go @@ -30,6 +30,11 @@ func (ContainerRegistryCacheRuleDataSource) Read() sdk.ResourceFunc { client := metadata.Client.Containers.CacheRulesClient subscriptionId := metadata.Client.Account.SubscriptionId + var state ContainerRegistryCacheRuleDataSourceModel + if err := metadata.Decode(&state); err != nil { + return err + } + containerRegistryId := metadata.ResourceData.Get("container_registry_id").(string) registryId, err := registries.ParseRegistryID(containerRegistryId) if err != nil { From 497ee730a2f554106a12571d54f6e2c139112689 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:44:32 -0400 Subject: [PATCH 37/74] Update internal/services/containers/container_registry_cache_rule_data_source.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_data_source.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_data_source.go b/internal/services/containers/container_registry_cache_rule_data_source.go index 08ae8747d78f..da5492a99d57 100644 --- a/internal/services/containers/container_registry_cache_rule_data_source.go +++ b/internal/services/containers/container_registry_cache_rule_data_source.go @@ -35,8 +35,7 @@ func (ContainerRegistryCacheRuleDataSource) Read() sdk.ResourceFunc { return err } - containerRegistryId := metadata.ResourceData.Get("container_registry_id").(string) - registryId, err := registries.ParseRegistryID(containerRegistryId) + registryId, err := registries.ParseRegistryID(metadata.ResourceData.Get("container_registry_id").(string)) if err != nil { return err } From 87c2f271d7a97f00706947de9142044bef687886 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:45:04 -0400 Subject: [PATCH 38/74] Update internal/services/containers/container_registry_cache_rule_data_source.go Co-authored-by: stephybun --- .../container_registry_cache_rule_data_source.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_data_source.go b/internal/services/containers/container_registry_cache_rule_data_source.go index da5492a99d57..af85a91788d6 100644 --- a/internal/services/containers/container_registry_cache_rule_data_source.go +++ b/internal/services/containers/container_registry_cache_rule_data_source.go @@ -52,19 +52,17 @@ func (ContainerRegistryCacheRuleDataSource) Read() sdk.ResourceFunc { } metadata.SetID(id) - metadata.ResourceData.Set("name", id.CacheRuleName) - metadata.ResourceData.Set("container_registry_id", containerRegistryId) + state.Name = id.CacheRuleName + state.ContainerRegistryId = registryId.ID() if model := resp.Model; model != nil { if props := model.Properties; props != nil { - metadata.ResourceData.Set("source_repo", props.SourceRepository) - metadata.ResourceData.Set("target_repo", props.TargetRepository) - if props.CredentialSetResourceId != nil { - metadata.ResourceData.Set("credential_set_id", props.CredentialSetResourceId) - } + state.SourceRepo = pointer.From(props.SourceRepository) + state.TargetRepo = pointer.From(props.TargetRepository) + state.CredentialSetId = pointer.From(props.CredentialSetResourceId) } } - return nil + return metadata.Encode(&state) }, } } From bbb106527fdeb799bebcc37d2e2b49421b7a9215 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:45:46 -0400 Subject: [PATCH 39/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 0773f24c7eae..016d0b468128 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -79,6 +79,11 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { subscriptionId := metadata.Client.Account.SubscriptionId ctx, cancel := timeouts.ForCreate(metadata.Client.StopContext, metadata.ResourceData) + var config ContainerRegistryCacheRuleModel + if err := metadata.Decode(&config); err != nil { + return err + } + defer cancel() log.Printf("[INFO] preparing arguments for Container Registry Cache Rule creation.") From 080a4a55a41109e8bd8c9918129364de9ebda4f5 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:46:10 -0400 Subject: [PATCH 40/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 016d0b468128..6e022f4b543d 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -92,12 +92,9 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { return err } - resourceGroup := registryId.ResourceGroupName - registryName := registryId.RegistryName - id := cacherules.NewCacheRuleID(subscriptionId, - resourceGroup, - registryName, + registryId.ResourceGroupName, + registryId.RegistryName, metadata.ResourceData.Get("name").(string), ) From 7cf6ab3dcb278945cd938ac9c6668761d4ff9246 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:46:41 -0400 Subject: [PATCH 41/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../container_registry_cache_rule_resource.go | 56 +++++++++---------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 6e022f4b543d..eec01975368a 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -98,44 +98,38 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { metadata.ResourceData.Get("name").(string), ) - if metadata.ResourceData.IsNewResource() { - existing, err := cacheRulesClient.Get(ctx, id) - if err != nil { - if !response.WasNotFound(existing.HttpResponse) { - return fmt.Errorf("checking for presence of existing %s: %s", id, err) - } - } - - if !response.WasNotFound(existing.HttpResponse) { - return tf.ImportAsExistsError("azurerm_container_registry_cache_rule", id.ID()) - } + existing, err := cacheRulesClient.Get(ctx, id) + if err != nil { + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for presence of existing %s: %s", id, err) + } + } - // TODO: make a check that the repo is available in the registry. - targetRepo := metadata.ResourceData.Get("target_repo").(string) + if !response.WasNotFound(existing.HttpResponse) { + return tf.ImportAsExistsError("azurerm_container_registry_cache_rule", id.ID()) + } - // TODO: validate the source repo. - sourceRepo := metadata.ResourceData.Get("source_repo").(string) + // TODO: make a check that the repo is available in the registry. + // TODO: validate the source repo. - credentialSetId := metadata.ResourceData.Get("credential_set_id").(string) + parameters := cacherules.CacheRule{ + Name: &id.CacheRuleName, + Properties: &cacherules.CacheRuleProperties{ + SourceRepository: pointer.To(config.SourceRepo), + TargetRepository: pointer.To(config.TargetRepo), + }, + } - parameters := cacherules.CacheRule{ - Name: &id.CacheRuleName, - Properties: &cacherules.CacheRuleProperties{ - SourceRepository: &sourceRepo, - TargetRepository: &targetRepo, - }, - } + // Conditionally add CredentialSetResourceId if credentialSetId is not empty + if config.CredentialSetId != "" { + parameters.Properties.CredentialSetResourceId = pointer.To(config.CredentialSetId) + } - // Conditionally add CredentialSetResourceId if credentialSetId is not empty - if credentialSetId != "" { - parameters.Properties.CredentialSetResourceId = &credentialSetId - } + if err := cacheRulesClient.CreateThenPoll(ctx, id, parameters); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } - if err := cacheRulesClient.CreateThenPoll(ctx, id, parameters); err != nil { - return fmt.Errorf("creating Container Registry Cache Rule %s: %+v", id, err) - } - } metadata.SetID(id) From a6f4d0327b3b6e43843b9fde05a80748251f55f6 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:47:00 -0400 Subject: [PATCH 42/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index eec01975368a..026044e1e052 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -133,7 +133,7 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { metadata.SetID(id) - return r.Read().Func(ctx, metadata) + return nil }, } } From ddec6db399cdd02b035f3501b85f27ee70fb079e Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:47:27 -0400 Subject: [PATCH 43/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 026044e1e052..770137ac4051 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -188,7 +188,7 @@ func (r ContainerRegistryCacheRule) Update() sdk.ResourceFunc { Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { cacheRulesClient := metadata.Client.Containers.CacheRulesClient - ctx, cancel := timeouts.ForRead(metadata.Client.StopContext, metadata.ResourceData) + ctx, cancel := timeouts.ForUpdate(metadata.Client.StopContext, metadata.ResourceData) defer cancel() log.Printf("[INFO] preparing arguments for Container Registry Cache Rule update.") From 318ce10a0e8fb3db574b738bb74d102c6806ab50 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:48:05 -0400 Subject: [PATCH 44/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 770137ac4051..d91c8d2f72cc 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -235,7 +235,7 @@ func (ContainerRegistryCacheRule) Delete() sdk.ResourceFunc { } if err := cacheRulesClient.DeleteThenPoll(ctx, *id); err != nil { - return fmt.Errorf("deleting Container Registry Cache Rule %s: %+v", *id, err) + return fmt.Errorf("deleting %s: %+v", *id, err) } return nil From 94698503db98c903cc4626824013fc439d55745a Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 09:48:35 -0400 Subject: [PATCH 45/74] Update internal/services/containers/container_registry_cache_rule_resource_test.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource_test.go b/internal/services/containers/container_registry_cache_rule_resource_test.go index a48c0a5e0744..848b6f12029c 100644 --- a/internal/services/containers/container_registry_cache_rule_resource_test.go +++ b/internal/services/containers/container_registry_cache_rule_resource_test.go @@ -59,7 +59,7 @@ func (t ContainerRegistryCacheRuleResource) Exists(ctx context.Context, clients return nil, fmt.Errorf("retrieving %s: %+v", id, err) } - return utils.Bool(resp.Model != nil), nil + return pointer.To(resp.Model != nil), nil } func (ContainerRegistryCacheRuleResource) basic(data acceptance.TestData) string { From 251b135f5dce1a6319769f545bc6d76024db1277 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Tue, 28 May 2024 10:32:01 -0400 Subject: [PATCH 46/74] feat: update go dep files --- go.mod | 29 +- go.sum | 448 +++++++ .../containerregistry/2023-07-01/client.go | 100 -- .../2023-07-01/credentialsets/README.md | 99 -- .../2023-07-01/credentialsets/client.go | 26 - .../2023-07-01/credentialsets/constants.go | 142 --- .../credentialsets/id_credentialset.go | 139 --- .../2023-07-01/credentialsets/id_registry.go | 130 -- .../credentialsets/method_create.go | 75 -- .../credentialsets/method_delete.go | 70 -- .../2023-07-01/credentialsets/method_get.go | 54 - .../2023-07-01/credentialsets/method_list.go | 91 -- .../credentialsets/method_update.go | 75 -- .../credentialsets/model_authcredential.go | 11 - .../credentialsets/model_credentialhealth.go | 10 - .../credentialsets/model_credentialset.go | 18 - .../model_credentialsetproperties.go | 29 - .../model_credentialsetupdateparameters.go | 13 - .../model_credentialsetupdateproperties.go | 8 - .../2023-07-01/credentialsets/predicates.go | 27 - .../2023-07-01/credentialsets/version.go | 12 - .../2023-07-01/operation/README.md | 42 - .../2023-07-01/operation/client.go | 26 - .../2023-07-01/operation/constants.go | 48 - .../method_registrieschecknameavailability.go | 60 - .../model_registrynamecheckrequest.go | 9 - .../operation/model_registrynamestatus.go | 10 - .../2023-07-01/operation/version.go | 12 - .../privateendpointconnections/README.md | 82 -- .../privateendpointconnections/client.go | 26 - .../privateendpointconnections/constants.go | 151 --- .../id_privateendpointconnection.go | 139 --- .../privateendpointconnections/id_registry.go | 130 -- .../method_createorupdate.go | 75 -- .../method_delete.go | 71 -- .../privateendpointconnections/method_get.go | 54 - .../privateendpointconnections/method_list.go | 91 -- .../model_privateendpoint.go | 8 - .../model_privateendpointconnection.go | 16 - ...del_privateendpointconnectionproperties.go | 10 - ...model_privatelinkserviceconnectionstate.go | 10 - .../privateendpointconnections/predicates.go | 27 - .../privateendpointconnections/version.go | 12 - .../2023-07-01/registries/README.md | 237 ---- .../2023-07-01/registries/client.go | 26 - .../2023-07-01/registries/constants.go | 772 ------------ .../registries/id_privatelinkresource.go | 139 --- .../2023-07-01/registries/id_registry.go | 130 -- .../2023-07-01/registries/method_create.go | 75 -- .../2023-07-01/registries/method_delete.go | 71 -- .../registries/method_generatecredentials.go | 75 -- .../2023-07-01/registries/method_get.go | 54 - .../method_getprivatelinkresource.go | 54 - .../registries/method_importimage.go | 74 -- .../2023-07-01/registries/method_list.go | 92 -- .../registries/method_listbyresourcegroup.go | 92 -- .../registries/method_listcredentials.go | 55 - .../method_listprivatelinkresources.go | 91 -- .../registries/method_listusages.go | 55 - .../registries/method_regeneratecredential.go | 59 - .../2023-07-01/registries/method_update.go | 75 -- .../registries/model_encryptionproperty.go | 9 - .../registries/model_exportpolicy.go | 8 - .../model_generatecredentialsparameters.go | 28 - .../model_generatecredentialsresult.go | 9 - .../registries/model_importimageparameters.go | 11 - .../registries/model_importsource.go | 11 - .../model_importsourcecredentials.go | 9 - .../2023-07-01/registries/model_iprule.go | 9 - .../registries/model_keyvaultproperties.go | 30 - .../registries/model_networkruleset.go | 9 - .../2023-07-01/registries/model_policies.go | 11 - .../registries/model_privateendpoint.go | 8 - .../model_privateendpointconnection.go | 16 - ...del_privateendpointconnectionproperties.go | 10 - .../registries/model_privatelinkresource.go | 11 - .../model_privatelinkresourceproperties.go | 10 - ...model_privatelinkserviceconnectionstate.go | 10 - .../registries/model_quarantinepolicy.go | 8 - .../model_regeneratecredentialparameters.go | 8 - .../2023-07-01/registries/model_registry.go | 21 - .../model_registrylistcredentialsresult.go | 9 - .../registries/model_registrypassword.go | 9 - .../registries/model_registryproperties.go | 39 - ...odel_registrypropertiesupdateparameters.go | 14 - .../model_registryupdateparameters.go | 15 - .../registries/model_registryusage.go | 11 - .../model_registryusagelistresult.go | 8 - .../registries/model_retentionpolicy.go | 28 - .../2023-07-01/registries/model_sku.go | 9 - .../2023-07-01/registries/model_status.go | 28 - .../registries/model_tokenpassword.go | 41 - .../registries/model_trustpolicy.go | 9 - .../2023-07-01/registries/predicates.go | 55 - .../2023-07-01/registries/version.go | 12 - .../2023-07-01/replications/README.md | 99 -- .../2023-07-01/replications/client.go | 26 - .../2023-07-01/replications/constants.go | 104 -- .../2023-07-01/replications/id_registry.go | 130 -- .../2023-07-01/replications/id_replication.go | 139 --- .../2023-07-01/replications/method_create.go | 75 -- .../2023-07-01/replications/method_delete.go | 71 -- .../2023-07-01/replications/method_get.go | 54 - .../2023-07-01/replications/method_list.go | 91 -- .../2023-07-01/replications/method_update.go | 75 -- .../replications/model_replication.go | 18 - .../model_replicationproperties.go | 11 - .../model_replicationupdateparameters.go | 9 - ...l_replicationupdateparametersproperties.go | 8 - .../2023-07-01/replications/model_status.go | 28 - .../2023-07-01/replications/predicates.go | 32 - .../2023-07-01/replications/version.go | 12 - .../2023-07-01/scopemaps/README.md | 99 -- .../2023-07-01/scopemaps/client.go | 26 - .../2023-07-01/scopemaps/constants.go | 63 - .../2023-07-01/scopemaps/id_registry.go | 130 -- .../2023-07-01/scopemaps/id_scopemap.go | 139 --- .../2023-07-01/scopemaps/method_create.go | 75 -- .../2023-07-01/scopemaps/method_delete.go | 71 -- .../2023-07-01/scopemaps/method_get.go | 54 - .../2023-07-01/scopemaps/method_list.go | 91 -- .../2023-07-01/scopemaps/method_update.go | 75 -- .../2023-07-01/scopemaps/model_scopemap.go | 16 - .../scopemaps/model_scopemapproperties.go | 30 - ...odel_scopemappropertiesupdateparameters.go | 9 - .../model_scopemapupdateparameters.go | 8 - .../2023-07-01/scopemaps/predicates.go | 27 - .../2023-07-01/scopemaps/version.go | 12 - .../2023-07-01/tokens/README.md | 99 -- .../2023-07-01/tokens/client.go | 26 - .../2023-07-01/tokens/constants.go | 186 --- .../2023-07-01/tokens/id_registry.go | 130 -- .../2023-07-01/tokens/id_token.go | 139 --- .../2023-07-01/tokens/method_create.go | 75 -- .../2023-07-01/tokens/method_delete.go | 71 -- .../2023-07-01/tokens/method_get.go | 54 - .../2023-07-01/tokens/method_list.go | 91 -- .../2023-07-01/tokens/method_update.go | 75 -- .../2023-07-01/tokens/model_token.go | 16 - .../tokens/model_tokencertificate.go | 29 - .../model_tokencredentialsproperties.go | 9 - .../2023-07-01/tokens/model_tokenpassword.go | 41 - .../tokens/model_tokenproperties.go | 30 - .../tokens/model_tokenupdateparameters.go | 8 - .../tokens/model_tokenupdateproperties.go | 10 - .../2023-07-01/tokens/predicates.go | 27 - .../2023-07-01/tokens/version.go | 12 - .../2023-07-01/webhooks/README.md | 148 --- .../2023-07-01/webhooks/client.go | 26 - .../2023-07-01/webhooks/constants.go | 154 --- .../2023-07-01/webhooks/id_registry.go | 130 -- .../2023-07-01/webhooks/id_webhook.go | 139 --- .../2023-07-01/webhooks/method_create.go | 75 -- .../2023-07-01/webhooks/method_delete.go | 71 -- .../2023-07-01/webhooks/method_get.go | 54 - .../webhooks/method_getcallbackconfig.go | 55 - .../2023-07-01/webhooks/method_list.go | 91 -- .../2023-07-01/webhooks/method_listevents.go | 91 -- .../2023-07-01/webhooks/method_ping.go | 55 - .../2023-07-01/webhooks/method_update.go | 75 -- .../2023-07-01/webhooks/model_actor.go | 8 - .../webhooks/model_callbackconfig.go | 9 - .../2023-07-01/webhooks/model_event.go | 10 - .../2023-07-01/webhooks/model_eventcontent.go | 32 - .../2023-07-01/webhooks/model_eventinfo.go | 8 - .../webhooks/model_eventrequestmessage.go | 12 - .../webhooks/model_eventresponsemessage.go | 12 - .../2023-07-01/webhooks/model_request.go | 12 - .../2023-07-01/webhooks/model_source.go | 9 - .../2023-07-01/webhooks/model_target.go | 16 - .../2023-07-01/webhooks/model_webhook.go | 18 - .../webhooks/model_webhookcreateparameters.go | 10 - .../webhooks/model_webhookproperties.go | 11 - ...model_webhookpropertiescreateparameters.go | 12 - ...model_webhookpropertiesupdateparameters.go | 12 - .../webhooks/model_webhookupdateparameters.go | 9 - .../2023-07-01/webhooks/predicates.go | 45 - .../2023-07-01/webhooks/version.go | 12 - .../github.com/hashicorp/hcl/v2/CHANGELOG.md | 30 +- vendor/github.com/hashicorp/hcl/v2/Makefile | 18 + .../hashicorp/hcl/v2/hclsyntax/expression.go | 215 +++- .../hashicorp/hcl/v2/hclsyntax/generate.go | 2 +- .../hashicorp/hcl/v2/hclsyntax/parser.go | 65 +- .../hcl/v2/hclsyntax/scan_string_lit.go | 25 +- .../hcl/v2/hclsyntax/scan_string_lit.rl | 2 + .../hashicorp/hcl/v2/hclsyntax/scan_tokens.go | 1101 +++++++++-------- .../hashicorp/hcl/v2/hclsyntax/scan_tokens.rl | 4 + .../hashicorp/hcl/v2/hclsyntax/spec.md | 2 +- .../hashicorp/hcl/v2/hclsyntax/token.go | 5 +- .../hcl/v2/hclsyntax/token_type_string.go | 12 +- vendor/github.com/hashicorp/hcl/v2/tools.go | 11 + .../go-cty/cty/convert/conversion_dynamic.go | 29 +- .../zclconf/go-cty/cty/primitive_type.go | 16 +- .../zclconf/go-cty/cty/unknown_refinement.go | 61 +- .../zclconf/go-cty/cty/value_range.go | 4 + vendor/golang.org/x/mod/modfile/rule.go | 21 +- vendor/golang.org/x/sys/execabs/execabs.go | 102 -- .../golang.org/x/sys/execabs/execabs_go118.go | 17 - .../golang.org/x/sys/execabs/execabs_go119.go | 20 - .../x/tools/cmd/stringer/stringer.go | 660 ++++++++++ .../x/tools/go/ast/astutil/enclosing.go | 8 +- .../x/tools/go/ast/astutil/rewrite.go | 8 +- .../x/tools/go/gcexportdata/gcexportdata.go | 2 +- .../tools/go/internal/packagesdriver/sizes.go | 15 +- vendor/golang.org/x/tools/go/packages/doc.go | 46 +- .../x/tools/go/packages/external.go | 79 +- .../golang.org/x/tools/go/packages/golist.go | 118 +- .../x/tools/go/packages/golist_overlay.go | 492 -------- .../x/tools/go/packages/packages.go | 221 ++-- .../x/tools/go/types/objectpath/objectpath.go | 147 +-- vendor/golang.org/x/tools/imports/forward.go | 4 +- .../x/tools/internal/aliases/aliases.go | 28 + .../x/tools/internal/aliases/aliases_go121.go | 30 + .../x/tools/internal/aliases/aliases_go122.go | 72 ++ .../x/tools/internal/event/keys/util.go | 21 + .../x/tools/internal/fastwalk/fastwalk.go | 196 --- .../internal/fastwalk/fastwalk_darwin.go | 119 -- .../fastwalk/fastwalk_dirent_fileno.go | 14 - .../internal/fastwalk/fastwalk_dirent_ino.go | 15 - .../fastwalk/fastwalk_dirent_namlen_bsd.go | 14 - .../fastwalk/fastwalk_dirent_namlen_linux.go | 29 - .../internal/fastwalk/fastwalk_portable.go | 38 - .../tools/internal/fastwalk/fastwalk_unix.go | 153 --- .../x/tools/internal/gcimporter/gcimporter.go | 10 +- .../x/tools/internal/gcimporter/iexport.go | 38 +- .../x/tools/internal/gcimporter/iimport.go | 67 +- .../internal/gcimporter/support_go117.go | 16 - .../internal/gcimporter/support_go118.go | 3 - .../x/tools/internal/gcimporter/unified_no.go | 4 +- .../tools/internal/gcimporter/unified_yes.go | 4 +- .../x/tools/internal/gcimporter/ureader_no.go | 19 - .../tools/internal/gcimporter/ureader_yes.go | 6 +- .../x/tools/internal/gocommand/invoke.go | 27 +- .../x/tools/internal/gopathwalk/walk.go | 289 +++-- .../x/tools/internal/imports/fix.go | 197 ++- .../x/tools/internal/imports/imports.go | 2 +- .../x/tools/internal/imports/mod.go | 290 +++-- .../x/tools/internal/imports/mod_cache.go | 116 +- .../x/tools/internal/imports/zstdlib.go | 61 + .../internal/packagesinternal/packages.go | 8 - .../internal/tokeninternal/tokeninternal.go | 28 +- .../x/tools/internal/typeparams/common.go | 59 +- .../x/tools/internal/typeparams/coretype.go | 25 +- .../internal/typeparams/enabled_go117.go | 12 - .../internal/typeparams/enabled_go118.go | 15 - .../x/tools/internal/typeparams/normalize.go | 20 +- .../internal/typeparams/typeparams_go117.go | 197 --- .../internal/typeparams/typeparams_go118.go | 151 --- .../internal/typesinternal/objectpath.go | 24 - .../x/tools/internal/typesinternal/recv.go | 43 + .../tools/internal/typesinternal/types_118.go | 3 - .../x/tools/internal/versions/features.go | 43 + .../x/tools/internal/versions/gover.go | 172 +++ .../x/tools/internal/versions/toolchain.go | 14 + .../internal/versions/toolchain_go119.go | 14 + .../internal/versions/toolchain_go120.go | 14 + .../internal/versions/toolchain_go121.go | 14 + .../x/tools/internal/versions/types.go | 19 + .../x/tools/internal/versions/types_go121.go | 30 + .../x/tools/internal/versions/types_go122.go | 41 + .../x/tools/internal/versions/versions.go | 57 + vendor/modules.txt | 68 +- 262 files changed, 3842 insertions(+), 12599 deletions(-) delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_delete.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_authcredential.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialhealth.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialset.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/method_registrieschecknameavailability.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamecheckrequest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamestatus.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_privateendpointconnection.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_registry.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_createorupdate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_delete.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_get.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_list.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpoint.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnection.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnectionproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privatelinkserviceconnectionstate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_registry.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_create.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_delete.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_generatecredentials.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_get.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_getprivatelinkresource.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_importimage.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_list.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listbyresourcegroup.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listcredentials.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listprivatelinkresources.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listusages.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_regeneratecredential.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_update.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_encryptionproperty.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_exportpolicy.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsresult.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importimageparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsource.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsourcecredentials.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_iprule.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_keyvaultproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_networkruleset.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_policies.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpoint.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnection.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnectionproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresource.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresourceproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkserviceconnectionstate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_quarantinepolicy.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_regeneratecredentialparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registry.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrylistcredentialsresult.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypassword.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypropertiesupdateparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryupdateparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusage.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusagelistresult.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_retentionpolicy.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_sku.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_status.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_tokenpassword.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_trustpolicy.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_registry.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_replication.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_create.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_delete.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_get.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_list.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_update.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replication.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparametersproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_status.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_registry.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_scopemap.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_create.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_delete.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_get.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_list.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_update.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemap.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemappropertiesupdateparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapupdateparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_registry.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_token.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_create.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_delete.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_get.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_list.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_update.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_token.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencertificate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencredentialsproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenpassword.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_registry.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_create.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_delete.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_get.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_getcallbackconfig.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_list.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_listevents.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_ping.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_update.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_actor.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_callbackconfig.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_event.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventcontent.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventinfo.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventrequestmessage.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventresponsemessage.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_request.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_source.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_target.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhook.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookcreateparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiescreateparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiesupdateparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookupdateparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/version.go create mode 100644 vendor/github.com/hashicorp/hcl/v2/Makefile create mode 100644 vendor/github.com/hashicorp/hcl/v2/tools.go delete mode 100644 vendor/golang.org/x/sys/execabs/execabs.go delete mode 100644 vendor/golang.org/x/sys/execabs/execabs_go118.go delete mode 100644 vendor/golang.org/x/sys/execabs/execabs_go119.go create mode 100644 vendor/golang.org/x/tools/cmd/stringer/stringer.go create mode 100644 vendor/golang.org/x/tools/internal/aliases/aliases.go create mode 100644 vendor/golang.org/x/tools/internal/aliases/aliases_go121.go create mode 100644 vendor/golang.org/x/tools/internal/aliases/aliases_go122.go create mode 100644 vendor/golang.org/x/tools/internal/event/keys/util.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_darwin.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go delete mode 100644 vendor/golang.org/x/tools/internal/gcimporter/support_go117.go delete mode 100644 vendor/golang.org/x/tools/internal/gcimporter/ureader_no.go delete mode 100644 vendor/golang.org/x/tools/internal/typeparams/enabled_go117.go delete mode 100644 vendor/golang.org/x/tools/internal/typeparams/enabled_go118.go delete mode 100644 vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go delete mode 100644 vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/objectpath.go create mode 100644 vendor/golang.org/x/tools/internal/typesinternal/recv.go create mode 100644 vendor/golang.org/x/tools/internal/versions/features.go create mode 100644 vendor/golang.org/x/tools/internal/versions/gover.go create mode 100644 vendor/golang.org/x/tools/internal/versions/toolchain.go create mode 100644 vendor/golang.org/x/tools/internal/versions/toolchain_go119.go create mode 100644 vendor/golang.org/x/tools/internal/versions/toolchain_go120.go create mode 100644 vendor/golang.org/x/tools/internal/versions/toolchain_go121.go create mode 100644 vendor/golang.org/x/tools/internal/versions/types.go create mode 100644 vendor/golang.org/x/tools/internal/versions/types_go121.go create mode 100644 vendor/golang.org/x/tools/internal/versions/types_go122.go create mode 100644 vendor/golang.org/x/tools/internal/versions/versions.go diff --git a/go.mod b/go.mod index 5189b72d185a..f889b97df420 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/tombuildsstuff/giovanni v0.27.0 github.com/tombuildsstuff/kermit v0.20240122.1123108 golang.org/x/crypto v0.21.0 - golang.org/x/tools v0.13.0 + golang.org/x/tools v0.19.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -45,7 +45,9 @@ require ( github.com/apparentlymart/go-textseg v1.0.0 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect + github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/golang/protobuf v1.5.3 // indirect + github.com/gookit/color v1.5.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -53,7 +55,8 @@ require ( github.com/hashicorp/go-plugin v1.5.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/hc-install v0.6.0 // indirect - github.com/hashicorp/hcl/v2 v2.18.0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/hcl/v2 v2.20.0 // indirect github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.19.0 // indirect @@ -63,7 +66,12 @@ require ( github.com/hashicorp/terraform-registry-address v0.2.2 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/katbyte/andreyvit-diff v0.0.1 // indirect + github.com/katbyte/sergi-go-diff v1.1.1 // indirect + github.com/katbyte/terrafmt v0.5.3 // indirect github.com/kr/text v0.2.0 // indirect + github.com/magiconair/properties v1.8.6 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -72,13 +80,24 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/oklog/run v1.1.0 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.1 // indirect github.com/rickb777/plural v1.4.1 // indirect + github.com/sirupsen/logrus v1.9.0 // indirect + github.com/spf13/afero v1.9.2 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/cobra v1.5.0 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.12.0 // indirect + github.com/subosito/gotenv v1.3.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - github.com/zclconf/go-cty v1.14.0 // indirect + github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect + github.com/zclconf/go-cty v1.14.3 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect - golang.org/x/mod v0.12.0 // indirect + golang.org/x/mod v0.16.0 // indirect golang.org/x/net v0.23.0 // indirect golang.org/x/oauth2 v0.16.0 // indirect golang.org/x/sys v0.18.0 // indirect @@ -88,6 +107,8 @@ require ( google.golang.org/grpc v1.58.3 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect + gopkg.in/ini.v1 v1.66.4 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect software.sslmate.com/src/go-pkcs12 v0.4.0 // indirect ) diff --git a/go.sum b/go.sum index 9924a1fd5fb1..5d420ca9b023 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,43 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go v66.0.0+incompatible h1:bmmC38SlE8/E81nNADlgmVGurPWMHDX2YNXVQMrBpEE= github.com/Azure/azure-sdk-for-go v66.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= @@ -22,6 +60,8 @@ github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+Z github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= @@ -45,9 +85,18 @@ github.com/btubbs/datetime v0.1.1/go.mod h1:n2BZ/2ltnRzNiz27aE3wUb2onNttQdC+WFxA github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/dave/jennifer v1.6.0 h1:MQ/6emI2xM7wt0tJzJzyUik2Q3Tcn2eE0vtYgh4GPVI= github.com/dave/jennifer v1.6.0/go.mod h1:AxTG893FiZKqxy3FP1kL80VMshSMuz2G+EgvszgGRnk= @@ -56,16 +105,27 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= github.com/go-git/go-billy/v5 v5.4.1/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg= github.com/go-git/go-git/v5 v5.8.1 h1:Zo79E4p7TRk0xoRgMq0RShiTHGKcKI4+DI6BfJc/Q+A= github.com/go-git/go-git/v5 v5.8.1/go.mod h1:FHFuoD6yGz5OSKEBK+aWN9Oah0q54Jxl0abmj6GnqAo= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= @@ -73,21 +133,74 @@ github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gookit/color v1.5.1 h1:Vjg2VEcdHpwq+oY63s/ksHrgJYCTo0bwWvmmYWdE9fQ= +github.com/gookit/color v1.5.1/go.mod h1:wZFzea4X8qN6vHOSP2apMb4/+w/orMznEzYsIHPaqKM= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -121,10 +234,16 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hc-install v0.6.0 h1:fDHnU7JNFNSQebVKYhHZ0va1bC6SrPQ8fpebsvNr2w4= github.com/hashicorp/hc-install v0.6.0/go.mod h1:10I912u3nntx9Umo1VAeYPUUuehk0aRQJYpMwbX5wQA= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.18.0 h1:wYnG7Lt31t2zYkcquwgKo6MWXzRUDIeIVU5naZwHLl8= github.com/hashicorp/hcl/v2 v2.18.0/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= +github.com/hashicorp/hcl/v2 v2.20.0 h1:l++cRs/5jQOiKVvqXZm/P1ZEfVXJmvLS9WSVxkaeTb4= +github.com/hashicorp/hcl/v2 v2.20.0/go.mod h1:WmcD/Ym72MDOOx5F62Ly+leloeu6H7m0pG7VBiU6pQk= github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80 h1:PFfGModn55JA0oBsvFghhj0v93me+Ctr3uHC/UmFAls= github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80/go.mod h1:Cxv+IJLuBiEhQ7pBYGEuORa0nr4U994pE8mYLuFd7v0= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= @@ -148,14 +267,28 @@ github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv2 github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/katbyte/andreyvit-diff v0.0.1 h1:2u6ofZeHrVgJjUzJ6JFlcfb3LeDq0rHxUH+WMHerELo= +github.com/katbyte/andreyvit-diff v0.0.1/go.mod h1:F6SME78YVaEk4agzLHhmsVwdVU+o/CtRnR0Bl9qBfrI= +github.com/katbyte/sergi-go-diff v1.1.1 h1:HelbPXYFHziR633zFq8QzwDY44jQ0Xy7COcLxNEWJtY= +github.com/katbyte/sergi-go-diff v1.1.1/go.mod h1:BxkLLDDB1iVQsnURErqoQMjkyXIlR0DefDKzZCUHNEw= +github.com/katbyte/terrafmt v0.5.3 h1:lBWDMv9YRurXFUuHXdpEJHkAO4YFluanIyiStK8zZJQ= +github.com/katbyte/terrafmt v0.5.3/go.mod h1:QSiA1xE/ld7Iy0VgByR8hWBmIy74Ah9XSeOYNE7JA7Y= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -165,6 +298,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magodo/terraform-provider-azurerm-example-gen v0.0.0-20220407025246-3a3ee0ab24a8 h1:HHSqLmPZaa8U66U7N2Gtx3gYptSHrUB/rB5t+6fZTkQ= github.com/magodo/terraform-provider-azurerm-example-gen v0.0.0-20220407025246-3a3ee0ab24a8/go.mod h1:iMzpAzVr2v/NUVie/apAYtZlFZYFndPcp6/E0VLxgAM= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -195,36 +330,63 @@ github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DV github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= +github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9 h1:czJCcoUR3FMpHnRQow2E84H/0CPrX1fMAGn9HugzyI4= github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9/go.mod h1:L8WrssTzvgYw34/Ppa0JpJfI7KKXZ2cVGI6Djt0brUU= github.com/rickb777/plural v1.2.0/go.mod h1:UdpyWFCGbo3mvK3f/PfZOAOrkjzJlYN/sD46XNWJ+Es= github.com/rickb777/plural v1.4.1 h1:5MMLcbIaapLFmvDGRT5iPk8877hpTPt8Y9cdSKRw9sU= github.com/rickb777/plural v1.4.1/go.mod h1:kdmXUpmKBJTS0FtG/TFumd//VBWsNTD7zOw7x4umxNw= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.2.0 h1:h9r9cf0+u7wSE+M183ZtMGgOJKiL96brpaz5ekfJCpM= github.com/skeema/knownhosts v1.2.0/go.mod h1:g4fPeYpque7P0xefxtGzV81ihjC8sX2IqpAoNkjxbMo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= +github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= +github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= +github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= github.com/tombuildsstuff/giovanni v0.27.0 h1:3CDNjauK78FIhvvCp0SAHlvNcPTcofR6zQXvxwhk4zY= github.com/tombuildsstuff/giovanni v0.27.0/go.mod h1:SviBdlwdVn2HyArdRABBqMUODBJ2adQHi+RFEVaO05I= github.com/tombuildsstuff/kermit v0.20240122.1123108 h1:icQaxsv/ANv/KC4Sr0V1trrWA/XIL+3QAVBDpiSTgj8= @@ -238,34 +400,115 @@ github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAh github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= +github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= +github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.14.0 h1:/Xrd39K7DXbHzlisFP9c4pHao4yyf+/Ug9LEz+Y/yhc= github.com/zclconf/go-cty v1.14.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.14.3 h1:1JXy1XroaGrzZuG6X9dt7HL6s9AwbY+l4UNL8o5B6ho= +github.com/zclconf/go-cty v1.14.3/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190502183928-7f726cade0ab/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -275,29 +518,79 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -313,9 +606,12 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= @@ -324,25 +620,162 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= @@ -352,16 +785,31 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= +gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= software.sslmate.com/src/go-pkcs12 v0.4.0 h1:H2g08FrTvSFKUj+D309j1DPfk5APnIdAQAB8aEykJ5k= software.sslmate.com/src/go-pkcs12 v0.4.0/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI= diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/client.go deleted file mode 100644 index 0b5041d944f2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/client.go +++ /dev/null @@ -1,100 +0,0 @@ -package v2023_07_01 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - CacheRules *cacherules.CacheRulesClient - CredentialSets *credentialsets.CredentialSetsClient - Operation *operation.OperationClient - PrivateEndpointConnections *privateendpointconnections.PrivateEndpointConnectionsClient - Registries *registries.RegistriesClient - Replications *replications.ReplicationsClient - ScopeMaps *scopemaps.ScopeMapsClient - Tokens *tokens.TokensClient - WebHooks *webhooks.WebHooksClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - cacheRulesClient, err := cacherules.NewCacheRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building CacheRules client: %+v", err) - } - configureFunc(cacheRulesClient.Client) - - credentialSetsClient, err := credentialsets.NewCredentialSetsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building CredentialSets client: %+v", err) - } - configureFunc(credentialSetsClient.Client) - - operationClient, err := operation.NewOperationClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Operation client: %+v", err) - } - configureFunc(operationClient.Client) - - privateEndpointConnectionsClient, err := privateendpointconnections.NewPrivateEndpointConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateEndpointConnections client: %+v", err) - } - configureFunc(privateEndpointConnectionsClient.Client) - - registriesClient, err := registries.NewRegistriesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Registries client: %+v", err) - } - configureFunc(registriesClient.Client) - - replicationsClient, err := replications.NewReplicationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Replications client: %+v", err) - } - configureFunc(replicationsClient.Client) - - scopeMapsClient, err := scopemaps.NewScopeMapsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ScopeMaps client: %+v", err) - } - configureFunc(scopeMapsClient.Client) - - tokensClient, err := tokens.NewTokensClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Tokens client: %+v", err) - } - configureFunc(tokensClient.Client) - - webHooksClient, err := webhooks.NewWebHooksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building WebHooks client: %+v", err) - } - configureFunc(webHooksClient.Client) - - return &Client{ - CacheRules: cacheRulesClient, - CredentialSets: credentialSetsClient, - Operation: operationClient, - PrivateEndpointConnections: privateEndpointConnectionsClient, - Registries: registriesClient, - Replications: replicationsClient, - ScopeMaps: scopeMapsClient, - Tokens: tokensClient, - WebHooks: webHooksClient, - }, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/README.md deleted file mode 100644 index 1928c694ff77..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/README.md +++ /dev/null @@ -1,99 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets` Documentation - -The `credentialsets` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/credentialsets" -``` - - -### Client Initialization - -```go -client := credentialsets.NewCredentialSetsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CredentialSetsClient.Create` - -```go -ctx := context.TODO() -id := credentialsets.NewCredentialSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "credentialSetValue") - -payload := credentialsets.CredentialSet{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `CredentialSetsClient.Delete` - -```go -ctx := context.TODO() -id := credentialsets.NewCredentialSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "credentialSetValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `CredentialSetsClient.Get` - -```go -ctx := context.TODO() -id := credentialsets.NewCredentialSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "credentialSetValue") - -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: `CredentialSetsClient.List` - -```go -ctx := context.TODO() -id := credentialsets.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -// alternatively `client.List(ctx, id)` can be used to do batched pagination -items, err := client.ListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `CredentialSetsClient.Update` - -```go -ctx := context.TODO() -id := credentialsets.NewCredentialSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "credentialSetValue") - -payload := credentialsets.CredentialSetUpdateParameters{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/client.go deleted file mode 100644 index cb20ca224462..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package credentialsets - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CredentialSetsClient struct { - Client *resourcemanager.Client -} - -func NewCredentialSetsClientWithBaseURI(sdkApi sdkEnv.Api) (*CredentialSetsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "credentialsets", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating CredentialSetsClient: %+v", err) - } - - return &CredentialSetsClient{ - Client: client, - }, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/constants.go deleted file mode 100644 index ff71d8ceaa07..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/constants.go +++ /dev/null @@ -1,142 +0,0 @@ -package credentialsets - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CredentialHealthStatus string - -const ( - CredentialHealthStatusHealthy CredentialHealthStatus = "Healthy" - CredentialHealthStatusUnhealthy CredentialHealthStatus = "Unhealthy" -) - -func PossibleValuesForCredentialHealthStatus() []string { - return []string{ - string(CredentialHealthStatusHealthy), - string(CredentialHealthStatusUnhealthy), - } -} - -func (s *CredentialHealthStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCredentialHealthStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCredentialHealthStatus(input string) (*CredentialHealthStatus, error) { - vals := map[string]CredentialHealthStatus{ - "healthy": CredentialHealthStatusHealthy, - "unhealthy": CredentialHealthStatusUnhealthy, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CredentialHealthStatus(input) - return &out, nil -} - -type CredentialName string - -const ( - CredentialNameCredentialOne CredentialName = "Credential1" -) - -func PossibleValuesForCredentialName() []string { - return []string{ - string(CredentialNameCredentialOne), - } -} - -func (s *CredentialName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCredentialName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCredentialName(input string) (*CredentialName, error) { - vals := map[string]CredentialName{ - "credential1": CredentialNameCredentialOne, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CredentialName(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go deleted file mode 100644 index 2538c5cf3110..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go +++ /dev/null @@ -1,139 +0,0 @@ -package credentialsets - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&CredentialSetId{}) -} - -var _ resourceids.ResourceId = &CredentialSetId{} - -// CredentialSetId is a struct representing the Resource ID for a Credential Set -type CredentialSetId struct { - SubscriptionId string - ResourceGroupName string - RegistryName string - CredentialSetName string -} - -// NewCredentialSetID returns a new CredentialSetId struct -func NewCredentialSetID(subscriptionId string, resourceGroupName string, registryName string, credentialSetName string) CredentialSetId { - return CredentialSetId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RegistryName: registryName, - CredentialSetName: credentialSetName, - } -} - -// ParseCredentialSetID parses 'input' into a CredentialSetId -func ParseCredentialSetID(input string) (*CredentialSetId, error) { - parser := resourceids.NewParserFromResourceIdType(&CredentialSetId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CredentialSetId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseCredentialSetIDInsensitively parses 'input' case-insensitively into a CredentialSetId -// note: this method should only be used for API response data and not user input -func ParseCredentialSetIDInsensitively(input string) (*CredentialSetId, error) { - parser := resourceids.NewParserFromResourceIdType(&CredentialSetId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CredentialSetId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *CredentialSetId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RegistryName, ok = input.Parsed["registryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) - } - - if id.CredentialSetName, ok = input.Parsed["credentialSetName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "credentialSetName", input) - } - - return nil -} - -// ValidateCredentialSetID checks that 'input' can be parsed as a Credential Set ID -func ValidateCredentialSetID(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 := ParseCredentialSetID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Credential Set ID -func (id CredentialSetId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/credentialSets/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.CredentialSetName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Credential Set ID -func (id CredentialSetId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), - resourceids.StaticSegment("staticRegistries", "registries", "registries"), - resourceids.UserSpecifiedSegment("registryName", "registryValue"), - resourceids.StaticSegment("staticCredentialSets", "credentialSets", "credentialSets"), - resourceids.UserSpecifiedSegment("credentialSetName", "credentialSetValue"), - } -} - -// String returns a human-readable description of this Credential Set ID -func (id CredentialSetId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Registry Name: %q", id.RegistryName), - fmt.Sprintf("Credential Set Name: %q", id.CredentialSetName), - } - return fmt.Sprintf("Credential Set (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go deleted file mode 100644 index e688b3adba09..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go +++ /dev/null @@ -1,130 +0,0 @@ -package credentialsets - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&RegistryId{}) -} - -var _ resourceids.ResourceId = &RegistryId{} - -// RegistryId is a struct representing the Resource ID for a Registry -type RegistryId struct { - SubscriptionId string - ResourceGroupName string - RegistryName string -} - -// NewRegistryID returns a new RegistryId struct -func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { - return RegistryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RegistryName: registryName, - } -} - -// ParseRegistryID parses 'input' into a RegistryId -func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegistryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId -// note: this method should only be used for API response data and not user input -func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegistryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RegistryName, ok = input.Parsed["registryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) - } - - return nil -} - -// ValidateRegistryID checks that 'input' can be parsed as a Registry ID -func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Registry ID -func (id RegistryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Registry ID -func (id RegistryId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), - resourceids.StaticSegment("staticRegistries", "registries", "registries"), - resourceids.UserSpecifiedSegment("registryName", "registryValue"), - } -} - -// String returns a human-readable description of this Registry ID -func (id RegistryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Registry Name: %q", id.RegistryName), - } - return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go deleted file mode 100644 index 63256806132e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go +++ /dev/null @@ -1,75 +0,0 @@ -package credentialsets - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *CredentialSet -} - -// Create ... -func (c CredentialSetsClient) Create(ctx context.Context, id CredentialSetId, input CredentialSet) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c CredentialSetsClient) CreateThenPoll(ctx context.Context, id CredentialSetId, input CredentialSet) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_delete.go deleted file mode 100644 index ccf0140f8ef7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package credentialsets - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c CredentialSetsClient) Delete(ctx context.Context, id CredentialSetId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c CredentialSetsClient) DeleteThenPoll(ctx context.Context, id CredentialSetId) error { - result, err := c.Delete(ctx, id) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go deleted file mode 100644 index 83eef1b0ac5e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package credentialsets - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CredentialSet -} - -// Get ... -func (c CredentialSetsClient) Get(ctx context.Context, id CredentialSetId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model CredentialSet - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go deleted file mode 100644 index 4b5743c50e66..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package credentialsets - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]CredentialSet -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []CredentialSet -} - -// List ... -func (c CredentialSetsClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/credentialSets", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]CredentialSet `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListComplete retrieves all the results into a single object -func (c CredentialSetsClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, CredentialSetOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c CredentialSetsClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate CredentialSetOperationPredicate) (result ListCompleteResult, err error) { - items := make([]CredentialSet, 0) - - resp, err := c.List(ctx, id) - if err != nil { - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go deleted file mode 100644 index 5451fc9ae4a8..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package credentialsets - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *CredentialSet -} - -// Update ... -func (c CredentialSetsClient) Update(ctx context.Context, id CredentialSetId, input CredentialSetUpdateParameters) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c CredentialSetsClient) UpdateThenPoll(ctx context.Context, id CredentialSetId, input CredentialSetUpdateParameters) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_authcredential.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_authcredential.go deleted file mode 100644 index 913c42662acb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_authcredential.go +++ /dev/null @@ -1,11 +0,0 @@ -package credentialsets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AuthCredential struct { - CredentialHealth *CredentialHealth `json:"credentialHealth,omitempty"` - Name *CredentialName `json:"name,omitempty"` - PasswordSecretIdentifier *string `json:"passwordSecretIdentifier,omitempty"` - UsernameSecretIdentifier *string `json:"usernameSecretIdentifier,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialhealth.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialhealth.go deleted file mode 100644 index ca30e48d6f25..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialhealth.go +++ /dev/null @@ -1,10 +0,0 @@ -package credentialsets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CredentialHealth struct { - ErrorCode *string `json:"errorCode,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - Status *CredentialHealthStatus `json:"status,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialset.go deleted file mode 100644 index 26779ccad5c0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialset.go +++ /dev/null @@ -1,18 +0,0 @@ -package credentialsets - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-helpers/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 CredentialSet struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Name *string `json:"name,omitempty"` - Properties *CredentialSetProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetproperties.go deleted file mode 100644 index 12298beeb143..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetproperties.go +++ /dev/null @@ -1,29 +0,0 @@ -package credentialsets - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CredentialSetProperties struct { - AuthCredentials *[]AuthCredential `json:"authCredentials,omitempty"` - CreationDate *string `json:"creationDate,omitempty"` - LoginServer *string `json:"loginServer,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} - -func (o *CredentialSetProperties) GetCreationDateAsTime() (*time.Time, error) { - if o.CreationDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreationDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *CredentialSetProperties) SetCreationDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreationDate = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateparameters.go deleted file mode 100644 index b43c63ad176e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateparameters.go +++ /dev/null @@ -1,13 +0,0 @@ -package credentialsets - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CredentialSetUpdateParameters struct { - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Properties *CredentialSetUpdateProperties `json:"properties,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateproperties.go deleted file mode 100644 index 718731e5d24c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package credentialsets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CredentialSetUpdateProperties struct { - AuthCredentials *[]AuthCredential `json:"authCredentials,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/predicates.go deleted file mode 100644 index c8e61730e35a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package credentialsets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CredentialSetOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p CredentialSetOperationPredicate) Matches(input CredentialSet) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/version.go deleted file mode 100644 index 51ea87a3966c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package credentialsets - -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 = "2023-07-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/credentialsets/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/README.md deleted file mode 100644 index edfbd6ac3dba..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation` Documentation - -The `operation` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation" -``` - - -### Client Initialization - -```go -client := operation.NewOperationClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `OperationClient.RegistriesCheckNameAvailability` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -payload := operation.RegistryNameCheckRequest{ - // ... -} - - -read, err := client.RegistriesCheckNameAvailability(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/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/client.go deleted file mode 100644 index bac3e788aaf3..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package operation - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OperationClient struct { - Client *resourcemanager.Client -} - -func NewOperationClientWithBaseURI(sdkApi sdkEnv.Api) (*OperationClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "operation", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating OperationClient: %+v", err) - } - - return &OperationClient{ - Client: client, - }, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/constants.go deleted file mode 100644 index 9582d637d757..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/constants.go +++ /dev/null @@ -1,48 +0,0 @@ -package operation - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerRegistryResourceType string - -const ( - ContainerRegistryResourceTypeMicrosoftPointContainerRegistryRegistries ContainerRegistryResourceType = "Microsoft.ContainerRegistry/registries" -) - -func PossibleValuesForContainerRegistryResourceType() []string { - return []string{ - string(ContainerRegistryResourceTypeMicrosoftPointContainerRegistryRegistries), - } -} - -func (s *ContainerRegistryResourceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseContainerRegistryResourceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseContainerRegistryResourceType(input string) (*ContainerRegistryResourceType, error) { - vals := map[string]ContainerRegistryResourceType{ - "microsoft.containerregistry/registries": ContainerRegistryResourceTypeMicrosoftPointContainerRegistryRegistries, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ContainerRegistryResourceType(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/method_registrieschecknameavailability.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/method_registrieschecknameavailability.go deleted file mode 100644 index 975fa300016e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/method_registrieschecknameavailability.go +++ /dev/null @@ -1,60 +0,0 @@ -package operation - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistriesCheckNameAvailabilityOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RegistryNameStatus -} - -// RegistriesCheckNameAvailability ... -func (c OperationClient) RegistriesCheckNameAvailability(ctx context.Context, id commonids.SubscriptionId, input RegistryNameCheckRequest) (result RegistriesCheckNameAvailabilityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.ContainerRegistry/checkNameAvailability", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model RegistryNameStatus - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamecheckrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamecheckrequest.go deleted file mode 100644 index 1f540d0ab5e9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamecheckrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package operation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryNameCheckRequest struct { - Name string `json:"name"` - Type ContainerRegistryResourceType `json:"type"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamestatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamestatus.go deleted file mode 100644 index cd64ec3c5fe7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/model_registrynamestatus.go +++ /dev/null @@ -1,10 +0,0 @@ -package operation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryNameStatus struct { - Message *string `json:"message,omitempty"` - NameAvailable *bool `json:"nameAvailable,omitempty"` - Reason *string `json:"reason,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/version.go deleted file mode 100644 index 1fb535b7cd2e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package operation - -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 = "2023-07-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/operation/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/README.md deleted file mode 100644 index d2d94fd16c97..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections` Documentation - -The `privateendpointconnections` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/privateendpointconnections" -``` - - -### Client Initialization - -```go -client := privateendpointconnections.NewPrivateEndpointConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateEndpointConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "privateEndpointConnectionValue") - -payload := privateendpointconnections.PrivateEndpointConnection{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateEndpointConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "privateEndpointConnectionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateEndpointConnectionsClient.Get` - -```go -ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "privateEndpointConnectionValue") - -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: `PrivateEndpointConnectionsClient.List` - -```go -ctx := context.TODO() -id := privateendpointconnections.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -// alternatively `client.List(ctx, id)` can be used to do batched pagination -items, err := client.ListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/client.go deleted file mode 100644 index 3bf7a6afe1ff..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package privateendpointconnections - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewPrivateEndpointConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*PrivateEndpointConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "privateendpointconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PrivateEndpointConnectionsClient: %+v", err) - } - - return &PrivateEndpointConnectionsClient{ - Client: client, - }, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/constants.go deleted file mode 100644 index d1ec47a5f332..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/constants.go +++ /dev/null @@ -1,151 +0,0 @@ -package privateendpointconnections - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActionsRequired string - -const ( - ActionsRequiredNone ActionsRequired = "None" - ActionsRequiredRecreate ActionsRequired = "Recreate" -) - -func PossibleValuesForActionsRequired() []string { - return []string{ - string(ActionsRequiredNone), - string(ActionsRequiredRecreate), - } -} - -func (s *ActionsRequired) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseActionsRequired(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseActionsRequired(input string) (*ActionsRequired, error) { - vals := map[string]ActionsRequired{ - "none": ActionsRequiredNone, - "recreate": ActionsRequiredRecreate, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ActionsRequired(input) - return &out, nil -} - -type ConnectionStatus string - -const ( - ConnectionStatusApproved ConnectionStatus = "Approved" - ConnectionStatusDisconnected ConnectionStatus = "Disconnected" - ConnectionStatusPending ConnectionStatus = "Pending" - ConnectionStatusRejected ConnectionStatus = "Rejected" -) - -func PossibleValuesForConnectionStatus() []string { - return []string{ - string(ConnectionStatusApproved), - string(ConnectionStatusDisconnected), - string(ConnectionStatusPending), - string(ConnectionStatusRejected), - } -} - -func (s *ConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionStatus(input string) (*ConnectionStatus, error) { - vals := map[string]ConnectionStatus{ - "approved": ConnectionStatusApproved, - "disconnected": ConnectionStatusDisconnected, - "pending": ConnectionStatusPending, - "rejected": ConnectionStatusRejected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_privateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_privateendpointconnection.go deleted file mode 100644 index 3a5c1c4d378f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_privateendpointconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -package privateendpointconnections - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&PrivateEndpointConnectionId{}) -} - -var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} - -// PrivateEndpointConnectionId is a struct representing the Resource ID for a Private Endpoint Connection -type PrivateEndpointConnectionId struct { - SubscriptionId string - ResourceGroupName string - RegistryName string - PrivateEndpointConnectionName string -} - -// NewPrivateEndpointConnectionID returns a new PrivateEndpointConnectionId struct -func NewPrivateEndpointConnectionID(subscriptionId string, resourceGroupName string, registryName string, privateEndpointConnectionName string) PrivateEndpointConnectionId { - return PrivateEndpointConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RegistryName: registryName, - PrivateEndpointConnectionName: privateEndpointConnectionName, - } -} - -// ParsePrivateEndpointConnectionID parses 'input' into a PrivateEndpointConnectionId -func ParsePrivateEndpointConnectionID(input string) (*PrivateEndpointConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateEndpointConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateEndpointConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateEndpointConnectionIDInsensitively parses 'input' case-insensitively into a PrivateEndpointConnectionId -// note: this method should only be used for API response data and not user input -func ParsePrivateEndpointConnectionIDInsensitively(input string) (*PrivateEndpointConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateEndpointConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateEndpointConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateEndpointConnectionId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RegistryName, ok = input.Parsed["registryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) - } - - if id.PrivateEndpointConnectionName, ok = input.Parsed["privateEndpointConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointConnectionName", input) - } - - return nil -} - -// ValidatePrivateEndpointConnectionID checks that 'input' can be parsed as a Private Endpoint Connection ID -func ValidatePrivateEndpointConnectionID(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 := ParsePrivateEndpointConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Endpoint Connection ID -func (id PrivateEndpointConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/privateEndpointConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.PrivateEndpointConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Endpoint Connection ID -func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), - resourceids.StaticSegment("staticRegistries", "registries", "registries"), - resourceids.UserSpecifiedSegment("registryName", "registryValue"), - resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionValue"), - } -} - -// String returns a human-readable description of this Private Endpoint Connection ID -func (id PrivateEndpointConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Registry Name: %q", id.RegistryName), - fmt.Sprintf("Private Endpoint Connection Name: %q", id.PrivateEndpointConnectionName), - } - return fmt.Sprintf("Private Endpoint Connection (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_registry.go deleted file mode 100644 index 109960059c43..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/id_registry.go +++ /dev/null @@ -1,130 +0,0 @@ -package privateendpointconnections - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&RegistryId{}) -} - -var _ resourceids.ResourceId = &RegistryId{} - -// RegistryId is a struct representing the Resource ID for a Registry -type RegistryId struct { - SubscriptionId string - ResourceGroupName string - RegistryName string -} - -// NewRegistryID returns a new RegistryId struct -func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { - return RegistryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RegistryName: registryName, - } -} - -// ParseRegistryID parses 'input' into a RegistryId -func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegistryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId -// note: this method should only be used for API response data and not user input -func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegistryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RegistryName, ok = input.Parsed["registryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) - } - - return nil -} - -// ValidateRegistryID checks that 'input' can be parsed as a Registry ID -func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Registry ID -func (id RegistryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Registry ID -func (id RegistryId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), - resourceids.StaticSegment("staticRegistries", "registries", "registries"), - resourceids.UserSpecifiedSegment("registryName", "registryValue"), - } -} - -// String returns a human-readable description of this Registry ID -func (id RegistryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Registry Name: %q", id.RegistryName), - } - return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_createorupdate.go deleted file mode 100644 index 73fb1683a66c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package privateendpointconnections - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *PrivateEndpointConnection -} - -// CreateOrUpdate ... -func (c PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, id PrivateEndpointConnectionId, input PrivateEndpointConnection) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c PrivateEndpointConnectionsClient) CreateOrUpdateThenPoll(ctx context.Context, id PrivateEndpointConnectionId, input PrivateEndpointConnection) error { - result, err := c.CreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing CreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after CreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_delete.go deleted file mode 100644 index 63c26e8f27f8..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package privateendpointconnections - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c PrivateEndpointConnectionsClient) Delete(ctx context.Context, id PrivateEndpointConnectionId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c PrivateEndpointConnectionsClient) DeleteThenPoll(ctx context.Context, id PrivateEndpointConnectionId) error { - result, err := c.Delete(ctx, id) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_get.go deleted file mode 100644 index 8dc28d7ff7af..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package privateendpointconnections - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateEndpointConnection -} - -// Get ... -func (c PrivateEndpointConnectionsClient) Get(ctx context.Context, id PrivateEndpointConnectionId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model PrivateEndpointConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_list.go deleted file mode 100644 index 9cd4e62acb0f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package privateendpointconnections - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PrivateEndpointConnection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateEndpointConnection -} - -// List ... -func (c PrivateEndpointConnectionsClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/privateEndpointConnections", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]PrivateEndpointConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListComplete retrieves all the results into a single object -func (c PrivateEndpointConnectionsClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PrivateEndpointConnectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateEndpointConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate PrivateEndpointConnectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]PrivateEndpointConnection, 0) - - resp, err := c.List(ctx, id) - if err != nil { - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpoint.go deleted file mode 100644 index 1bc8cf2a97c3..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpoint.go +++ /dev/null @@ -1,8 +0,0 @@ -package privateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpoint struct { - Id *string `json:"id,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnection.go deleted file mode 100644 index 977fe056fe33..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnection.go +++ /dev/null @@ -1,16 +0,0 @@ -package privateendpointconnections - -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 PrivateEndpointConnection struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnectionproperties.go deleted file mode 100644 index 26d6b8a94640..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointConnectionProperties struct { - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privatelinkserviceconnectionstate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 4501bc5a3f14..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionState struct { - ActionsRequired *ActionsRequired `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *ConnectionStatus `json:"status,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/predicates.go deleted file mode 100644 index 4a03a91ce52c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package privateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointConnectionOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p PrivateEndpointConnectionOperationPredicate) Matches(input PrivateEndpointConnection) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/version.go deleted file mode 100644 index 35cb9c96d6d1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpointconnections - -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 = "2023-07-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privateendpointconnections/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/README.md deleted file mode 100644 index 5e8f78ccc903..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/README.md +++ /dev/null @@ -1,237 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries` Documentation - -The `registries` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries" -``` - - -### Client Initialization - -```go -client := registries.NewRegistriesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RegistriesClient.Create` - -```go -ctx := context.TODO() -id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -payload := registries.Registry{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RegistriesClient.Delete` - -```go -ctx := context.TODO() -id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RegistriesClient.GenerateCredentials` - -```go -ctx := context.TODO() -id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -payload := registries.GenerateCredentialsParameters{ - // ... -} - - -if err := client.GenerateCredentialsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RegistriesClient.Get` - -```go -ctx := context.TODO() -id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -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: `RegistriesClient.GetPrivateLinkResource` - -```go -ctx := context.TODO() -id := registries.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "privateLinkResourceValue") - -read, err := client.GetPrivateLinkResource(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RegistriesClient.ImportImage` - -```go -ctx := context.TODO() -id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -payload := registries.ImportImageParameters{ - // ... -} - - -if err := client.ImportImageThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RegistriesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.List(ctx, id)` can be used to do batched pagination -items, err := client.ListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `RegistriesClient.ListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `RegistriesClient.ListCredentials` - -```go -ctx := context.TODO() -id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -read, err := client.ListCredentials(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RegistriesClient.ListPrivateLinkResources` - -```go -ctx := context.TODO() -id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -// alternatively `client.ListPrivateLinkResources(ctx, id)` can be used to do batched pagination -items, err := client.ListPrivateLinkResourcesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `RegistriesClient.ListUsages` - -```go -ctx := context.TODO() -id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -read, err := client.ListUsages(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RegistriesClient.RegenerateCredential` - -```go -ctx := context.TODO() -id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -payload := registries.RegenerateCredentialParameters{ - // ... -} - - -read, err := client.RegenerateCredential(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RegistriesClient.Update` - -```go -ctx := context.TODO() -id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -payload := registries.RegistryUpdateParameters{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/client.go deleted file mode 100644 index f3defc5ecd2e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package registries - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistriesClient struct { - Client *resourcemanager.Client -} - -func NewRegistriesClientWithBaseURI(sdkApi sdkEnv.Api) (*RegistriesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "registries", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RegistriesClient: %+v", err) - } - - return &RegistriesClient{ - Client: client, - }, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/constants.go deleted file mode 100644 index 2f605a8d6bcf..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/constants.go +++ /dev/null @@ -1,772 +0,0 @@ -package registries - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Action string - -const ( - ActionAllow Action = "Allow" -) - -func PossibleValuesForAction() []string { - return []string{ - string(ActionAllow), - } -} - -func (s *Action) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAction(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAction(input string) (*Action, error) { - vals := map[string]Action{ - "allow": ActionAllow, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Action(input) - return &out, nil -} - -type ActionsRequired string - -const ( - ActionsRequiredNone ActionsRequired = "None" - ActionsRequiredRecreate ActionsRequired = "Recreate" -) - -func PossibleValuesForActionsRequired() []string { - return []string{ - string(ActionsRequiredNone), - string(ActionsRequiredRecreate), - } -} - -func (s *ActionsRequired) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseActionsRequired(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseActionsRequired(input string) (*ActionsRequired, error) { - vals := map[string]ActionsRequired{ - "none": ActionsRequiredNone, - "recreate": ActionsRequiredRecreate, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ActionsRequired(input) - return &out, nil -} - -type ConnectionStatus string - -const ( - ConnectionStatusApproved ConnectionStatus = "Approved" - ConnectionStatusDisconnected ConnectionStatus = "Disconnected" - ConnectionStatusPending ConnectionStatus = "Pending" - ConnectionStatusRejected ConnectionStatus = "Rejected" -) - -func PossibleValuesForConnectionStatus() []string { - return []string{ - string(ConnectionStatusApproved), - string(ConnectionStatusDisconnected), - string(ConnectionStatusPending), - string(ConnectionStatusRejected), - } -} - -func (s *ConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionStatus(input string) (*ConnectionStatus, error) { - vals := map[string]ConnectionStatus{ - "approved": ConnectionStatusApproved, - "disconnected": ConnectionStatusDisconnected, - "pending": ConnectionStatusPending, - "rejected": ConnectionStatusRejected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionStatus(input) - return &out, nil -} - -type DefaultAction string - -const ( - DefaultActionAllow DefaultAction = "Allow" - DefaultActionDeny DefaultAction = "Deny" -) - -func PossibleValuesForDefaultAction() []string { - return []string{ - string(DefaultActionAllow), - string(DefaultActionDeny), - } -} - -func (s *DefaultAction) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDefaultAction(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDefaultAction(input string) (*DefaultAction, error) { - vals := map[string]DefaultAction{ - "allow": DefaultActionAllow, - "deny": DefaultActionDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DefaultAction(input) - return &out, nil -} - -type EncryptionStatus string - -const ( - EncryptionStatusDisabled EncryptionStatus = "disabled" - EncryptionStatusEnabled EncryptionStatus = "enabled" -) - -func PossibleValuesForEncryptionStatus() []string { - return []string{ - string(EncryptionStatusDisabled), - string(EncryptionStatusEnabled), - } -} - -func (s *EncryptionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEncryptionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEncryptionStatus(input string) (*EncryptionStatus, error) { - vals := map[string]EncryptionStatus{ - "disabled": EncryptionStatusDisabled, - "enabled": EncryptionStatusEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EncryptionStatus(input) - return &out, nil -} - -type ExportPolicyStatus string - -const ( - ExportPolicyStatusDisabled ExportPolicyStatus = "disabled" - ExportPolicyStatusEnabled ExportPolicyStatus = "enabled" -) - -func PossibleValuesForExportPolicyStatus() []string { - return []string{ - string(ExportPolicyStatusDisabled), - string(ExportPolicyStatusEnabled), - } -} - -func (s *ExportPolicyStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExportPolicyStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExportPolicyStatus(input string) (*ExportPolicyStatus, error) { - vals := map[string]ExportPolicyStatus{ - "disabled": ExportPolicyStatusDisabled, - "enabled": ExportPolicyStatusEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExportPolicyStatus(input) - return &out, nil -} - -type ImportMode string - -const ( - ImportModeForce ImportMode = "Force" - ImportModeNoForce ImportMode = "NoForce" -) - -func PossibleValuesForImportMode() []string { - return []string{ - string(ImportModeForce), - string(ImportModeNoForce), - } -} - -func (s *ImportMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseImportMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseImportMode(input string) (*ImportMode, error) { - vals := map[string]ImportMode{ - "force": ImportModeForce, - "noforce": ImportModeNoForce, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ImportMode(input) - return &out, nil -} - -type NetworkRuleBypassOptions string - -const ( - NetworkRuleBypassOptionsAzureServices NetworkRuleBypassOptions = "AzureServices" - NetworkRuleBypassOptionsNone NetworkRuleBypassOptions = "None" -) - -func PossibleValuesForNetworkRuleBypassOptions() []string { - return []string{ - string(NetworkRuleBypassOptionsAzureServices), - string(NetworkRuleBypassOptionsNone), - } -} - -func (s *NetworkRuleBypassOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkRuleBypassOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkRuleBypassOptions(input string) (*NetworkRuleBypassOptions, error) { - vals := map[string]NetworkRuleBypassOptions{ - "azureservices": NetworkRuleBypassOptionsAzureServices, - "none": NetworkRuleBypassOptionsNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkRuleBypassOptions(input) - return &out, nil -} - -type PasswordName string - -const ( - PasswordNamePassword PasswordName = "password" - PasswordNamePasswordTwo PasswordName = "password2" -) - -func PossibleValuesForPasswordName() []string { - return []string{ - string(PasswordNamePassword), - string(PasswordNamePasswordTwo), - } -} - -func (s *PasswordName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePasswordName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePasswordName(input string) (*PasswordName, error) { - vals := map[string]PasswordName{ - "password": PasswordNamePassword, - "password2": PasswordNamePasswordTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PasswordName(input) - return &out, nil -} - -type PolicyStatus string - -const ( - PolicyStatusDisabled PolicyStatus = "disabled" - PolicyStatusEnabled PolicyStatus = "enabled" -) - -func PossibleValuesForPolicyStatus() []string { - return []string{ - string(PolicyStatusDisabled), - string(PolicyStatusEnabled), - } -} - -func (s *PolicyStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePolicyStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePolicyStatus(input string) (*PolicyStatus, error) { - vals := map[string]PolicyStatus{ - "disabled": PolicyStatusDisabled, - "enabled": PolicyStatusEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PolicyStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicNetworkAccess string - -const ( - PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" -) - -func PossibleValuesForPublicNetworkAccess() []string { - return []string{ - string(PublicNetworkAccessDisabled), - string(PublicNetworkAccessEnabled), - } -} - -func (s *PublicNetworkAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicNetworkAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicNetworkAccess(input string) (*PublicNetworkAccess, error) { - vals := map[string]PublicNetworkAccess{ - "disabled": PublicNetworkAccessDisabled, - "enabled": PublicNetworkAccessEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicNetworkAccess(input) - return &out, nil -} - -type RegistryUsageUnit string - -const ( - RegistryUsageUnitBytes RegistryUsageUnit = "Bytes" - RegistryUsageUnitCount RegistryUsageUnit = "Count" -) - -func PossibleValuesForRegistryUsageUnit() []string { - return []string{ - string(RegistryUsageUnitBytes), - string(RegistryUsageUnitCount), - } -} - -func (s *RegistryUsageUnit) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRegistryUsageUnit(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRegistryUsageUnit(input string) (*RegistryUsageUnit, error) { - vals := map[string]RegistryUsageUnit{ - "bytes": RegistryUsageUnitBytes, - "count": RegistryUsageUnitCount, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RegistryUsageUnit(input) - return &out, nil -} - -type SkuName string - -const ( - SkuNameBasic SkuName = "Basic" - SkuNameClassic SkuName = "Classic" - SkuNamePremium SkuName = "Premium" - SkuNameStandard SkuName = "Standard" -) - -func PossibleValuesForSkuName() []string { - return []string{ - string(SkuNameBasic), - string(SkuNameClassic), - string(SkuNamePremium), - string(SkuNameStandard), - } -} - -func (s *SkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSkuName(input string) (*SkuName, error) { - vals := map[string]SkuName{ - "basic": SkuNameBasic, - "classic": SkuNameClassic, - "premium": SkuNamePremium, - "standard": SkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SkuName(input) - return &out, nil -} - -type SkuTier string - -const ( - SkuTierBasic SkuTier = "Basic" - SkuTierClassic SkuTier = "Classic" - SkuTierPremium SkuTier = "Premium" - SkuTierStandard SkuTier = "Standard" -) - -func PossibleValuesForSkuTier() []string { - return []string{ - string(SkuTierBasic), - string(SkuTierClassic), - string(SkuTierPremium), - string(SkuTierStandard), - } -} - -func (s *SkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSkuTier(input string) (*SkuTier, error) { - vals := map[string]SkuTier{ - "basic": SkuTierBasic, - "classic": SkuTierClassic, - "premium": SkuTierPremium, - "standard": SkuTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SkuTier(input) - return &out, nil -} - -type TokenPasswordName string - -const ( - TokenPasswordNamePasswordOne TokenPasswordName = "password1" - TokenPasswordNamePasswordTwo TokenPasswordName = "password2" -) - -func PossibleValuesForTokenPasswordName() []string { - return []string{ - string(TokenPasswordNamePasswordOne), - string(TokenPasswordNamePasswordTwo), - } -} - -func (s *TokenPasswordName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTokenPasswordName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTokenPasswordName(input string) (*TokenPasswordName, error) { - vals := map[string]TokenPasswordName{ - "password1": TokenPasswordNamePasswordOne, - "password2": TokenPasswordNamePasswordTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TokenPasswordName(input) - return &out, nil -} - -type TrustPolicyType string - -const ( - TrustPolicyTypeNotary TrustPolicyType = "Notary" -) - -func PossibleValuesForTrustPolicyType() []string { - return []string{ - string(TrustPolicyTypeNotary), - } -} - -func (s *TrustPolicyType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTrustPolicyType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTrustPolicyType(input string) (*TrustPolicyType, error) { - vals := map[string]TrustPolicyType{ - "notary": TrustPolicyTypeNotary, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TrustPolicyType(input) - return &out, nil -} - -type ZoneRedundancy string - -const ( - ZoneRedundancyDisabled ZoneRedundancy = "Disabled" - ZoneRedundancyEnabled ZoneRedundancy = "Enabled" -) - -func PossibleValuesForZoneRedundancy() []string { - return []string{ - string(ZoneRedundancyDisabled), - string(ZoneRedundancyEnabled), - } -} - -func (s *ZoneRedundancy) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseZoneRedundancy(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseZoneRedundancy(input string) (*ZoneRedundancy, error) { - vals := map[string]ZoneRedundancy{ - "disabled": ZoneRedundancyDisabled, - "enabled": ZoneRedundancyEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ZoneRedundancy(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go deleted file mode 100644 index ebf2b8bcac5f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go +++ /dev/null @@ -1,139 +0,0 @@ -package registries - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&PrivateLinkResourceId{}) -} - -var _ resourceids.ResourceId = &PrivateLinkResourceId{} - -// PrivateLinkResourceId is a struct representing the Resource ID for a Private Link Resource -type PrivateLinkResourceId struct { - SubscriptionId string - ResourceGroupName string - RegistryName string - PrivateLinkResourceName string -} - -// NewPrivateLinkResourceID returns a new PrivateLinkResourceId struct -func NewPrivateLinkResourceID(subscriptionId string, resourceGroupName string, registryName string, privateLinkResourceName string) PrivateLinkResourceId { - return PrivateLinkResourceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RegistryName: registryName, - PrivateLinkResourceName: privateLinkResourceName, - } -} - -// ParsePrivateLinkResourceID parses 'input' into a PrivateLinkResourceId -func ParsePrivateLinkResourceID(input string) (*PrivateLinkResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkResourceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateLinkResourceIDInsensitively parses 'input' case-insensitively into a PrivateLinkResourceId -// note: this method should only be used for API response data and not user input -func ParsePrivateLinkResourceIDInsensitively(input string) (*PrivateLinkResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkResourceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateLinkResourceId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RegistryName, ok = input.Parsed["registryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) - } - - if id.PrivateLinkResourceName, ok = input.Parsed["privateLinkResourceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkResourceName", input) - } - - return nil -} - -// ValidatePrivateLinkResourceID checks that 'input' can be parsed as a Private Link Resource ID -func ValidatePrivateLinkResourceID(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 := ParsePrivateLinkResourceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Link Resource ID -func (id PrivateLinkResourceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/privateLinkResources/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.PrivateLinkResourceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Link Resource ID -func (id PrivateLinkResourceId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), - resourceids.StaticSegment("staticRegistries", "registries", "registries"), - resourceids.UserSpecifiedSegment("registryName", "registryValue"), - resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceValue"), - } -} - -// String returns a human-readable description of this Private Link Resource ID -func (id PrivateLinkResourceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Registry Name: %q", id.RegistryName), - fmt.Sprintf("Private Link Resource Name: %q", id.PrivateLinkResourceName), - } - return fmt.Sprintf("Private Link Resource (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_registry.go deleted file mode 100644 index ced90cd79e7a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/id_registry.go +++ /dev/null @@ -1,130 +0,0 @@ -package registries - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&RegistryId{}) -} - -var _ resourceids.ResourceId = &RegistryId{} - -// RegistryId is a struct representing the Resource ID for a Registry -type RegistryId struct { - SubscriptionId string - ResourceGroupName string - RegistryName string -} - -// NewRegistryID returns a new RegistryId struct -func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { - return RegistryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RegistryName: registryName, - } -} - -// ParseRegistryID parses 'input' into a RegistryId -func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegistryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId -// note: this method should only be used for API response data and not user input -func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegistryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RegistryName, ok = input.Parsed["registryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) - } - - return nil -} - -// ValidateRegistryID checks that 'input' can be parsed as a Registry ID -func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Registry ID -func (id RegistryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Registry ID -func (id RegistryId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), - resourceids.StaticSegment("staticRegistries", "registries", "registries"), - resourceids.UserSpecifiedSegment("registryName", "registryValue"), - } -} - -// String returns a human-readable description of this Registry ID -func (id RegistryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Registry Name: %q", id.RegistryName), - } - return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_create.go deleted file mode 100644 index 5b8db55a0b05..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_create.go +++ /dev/null @@ -1,75 +0,0 @@ -package registries - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Registry -} - -// Create ... -func (c RegistriesClient) Create(ctx context.Context, id RegistryId, input Registry) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c RegistriesClient) CreateThenPoll(ctx context.Context, id RegistryId, input Registry) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_delete.go deleted file mode 100644 index 4a0877f344a8..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package registries - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c RegistriesClient) Delete(ctx context.Context, id RegistryId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c RegistriesClient) DeleteThenPoll(ctx context.Context, id RegistryId) error { - result, err := c.Delete(ctx, id) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_generatecredentials.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_generatecredentials.go deleted file mode 100644 index 12d06ca2ab40..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_generatecredentials.go +++ /dev/null @@ -1,75 +0,0 @@ -package registries - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GenerateCredentialsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *GenerateCredentialsResult -} - -// GenerateCredentials ... -func (c RegistriesClient) GenerateCredentials(ctx context.Context, id RegistryId, input GenerateCredentialsParameters) (result GenerateCredentialsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/generateCredentials", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// GenerateCredentialsThenPoll performs GenerateCredentials then polls until it's completed -func (c RegistriesClient) GenerateCredentialsThenPoll(ctx context.Context, id RegistryId, input GenerateCredentialsParameters) error { - result, err := c.GenerateCredentials(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GenerateCredentials: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GenerateCredentials: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_get.go deleted file mode 100644 index bfd0c8119211..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package registries - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Registry -} - -// Get ... -func (c RegistriesClient) Get(ctx context.Context, id RegistryId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model Registry - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_getprivatelinkresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_getprivatelinkresource.go deleted file mode 100644 index 1f017340494c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_getprivatelinkresource.go +++ /dev/null @@ -1,54 +0,0 @@ -package registries - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetPrivateLinkResourceOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateLinkResource -} - -// GetPrivateLinkResource ... -func (c RegistriesClient) GetPrivateLinkResource(ctx context.Context, id PrivateLinkResourceId) (result GetPrivateLinkResourceOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model PrivateLinkResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_importimage.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_importimage.go deleted file mode 100644 index 73da0c5ca7b7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_importimage.go +++ /dev/null @@ -1,74 +0,0 @@ -package registries - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImportImageOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ImportImage ... -func (c RegistriesClient) ImportImage(ctx context.Context, id RegistryId, input ImportImageParameters) (result ImportImageOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/importImage", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// ImportImageThenPoll performs ImportImage then polls until it's completed -func (c RegistriesClient) ImportImageThenPoll(ctx context.Context, id RegistryId, input ImportImageParameters) error { - result, err := c.ImportImage(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ImportImage: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ImportImage: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_list.go deleted file mode 100644 index 766fbb43fd1f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package registries - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Registry -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Registry -} - -// List ... -func (c RegistriesClient) List(ctx context.Context, id commonids.SubscriptionId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.ContainerRegistry/registries", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]Registry `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListComplete retrieves all the results into a single object -func (c RegistriesClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, RegistryOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RegistriesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate RegistryOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Registry, 0) - - resp, err := c.List(ctx, id) - if err != nil { - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listbyresourcegroup.go deleted file mode 100644 index 81be607d690d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package registries - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Registry -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []Registry -} - -// ListByResourceGroup ... -func (c RegistriesClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.ContainerRegistry/registries", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]Registry `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByResourceGroupComplete retrieves all the results into a single object -func (c RegistriesClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, RegistryOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RegistriesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate RegistryOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]Registry, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listcredentials.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listcredentials.go deleted file mode 100644 index cc5f3f64da15..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listcredentials.go +++ /dev/null @@ -1,55 +0,0 @@ -package registries - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListCredentialsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RegistryListCredentialsResult -} - -// ListCredentials ... -func (c RegistriesClient) ListCredentials(ctx context.Context, id RegistryId) (result ListCredentialsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listCredentials", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model RegistryListCredentialsResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listprivatelinkresources.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listprivatelinkresources.go deleted file mode 100644 index 93dd60b9c6ff..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listprivatelinkresources.go +++ /dev/null @@ -1,91 +0,0 @@ -package registries - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListPrivateLinkResourcesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PrivateLinkResource -} - -type ListPrivateLinkResourcesCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateLinkResource -} - -// ListPrivateLinkResources ... -func (c RegistriesClient) ListPrivateLinkResources(ctx context.Context, id RegistryId) (result ListPrivateLinkResourcesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/privateLinkResources", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]PrivateLinkResource `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListPrivateLinkResourcesComplete retrieves all the results into a single object -func (c RegistriesClient) ListPrivateLinkResourcesComplete(ctx context.Context, id RegistryId) (ListPrivateLinkResourcesCompleteResult, error) { - return c.ListPrivateLinkResourcesCompleteMatchingPredicate(ctx, id, PrivateLinkResourceOperationPredicate{}) -} - -// ListPrivateLinkResourcesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RegistriesClient) ListPrivateLinkResourcesCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate PrivateLinkResourceOperationPredicate) (result ListPrivateLinkResourcesCompleteResult, err error) { - items := make([]PrivateLinkResource, 0) - - resp, err := c.ListPrivateLinkResources(ctx, id) - if err != nil { - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListPrivateLinkResourcesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listusages.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listusages.go deleted file mode 100644 index 6a981aee2670..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_listusages.go +++ /dev/null @@ -1,55 +0,0 @@ -package registries - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListUsagesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RegistryUsageListResult -} - -// ListUsages ... -func (c RegistriesClient) ListUsages(ctx context.Context, id RegistryId) (result ListUsagesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/listUsages", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model RegistryUsageListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_regeneratecredential.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_regeneratecredential.go deleted file mode 100644 index 4db46fb579bc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_regeneratecredential.go +++ /dev/null @@ -1,59 +0,0 @@ -package registries - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegenerateCredentialOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RegistryListCredentialsResult -} - -// RegenerateCredential ... -func (c RegistriesClient) RegenerateCredential(ctx context.Context, id RegistryId, input RegenerateCredentialParameters) (result RegenerateCredentialOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/regenerateCredential", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model RegistryListCredentialsResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_update.go deleted file mode 100644 index 61af909a492b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package registries - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Registry -} - -// Update ... -func (c RegistriesClient) Update(ctx context.Context, id RegistryId, input RegistryUpdateParameters) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c RegistriesClient) UpdateThenPoll(ctx context.Context, id RegistryId, input RegistryUpdateParameters) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_encryptionproperty.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_encryptionproperty.go deleted file mode 100644 index 44af317bc4ef..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_encryptionproperty.go +++ /dev/null @@ -1,9 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EncryptionProperty struct { - KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` - Status *EncryptionStatus `json:"status,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_exportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_exportpolicy.go deleted file mode 100644 index bcbc7e5b8e0c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_exportpolicy.go +++ /dev/null @@ -1,8 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExportPolicy struct { - Status *ExportPolicyStatus `json:"status,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsparameters.go deleted file mode 100644 index c06016d18bae..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsparameters.go +++ /dev/null @@ -1,28 +0,0 @@ -package registries - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GenerateCredentialsParameters struct { - Expiry *string `json:"expiry,omitempty"` - Name *TokenPasswordName `json:"name,omitempty"` - TokenId *string `json:"tokenId,omitempty"` -} - -func (o *GenerateCredentialsParameters) GetExpiryAsTime() (*time.Time, error) { - if o.Expiry == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Expiry, "2006-01-02T15:04:05Z07:00") -} - -func (o *GenerateCredentialsParameters) SetExpiryAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Expiry = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsresult.go deleted file mode 100644 index 04e9f2ca4e13..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_generatecredentialsresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GenerateCredentialsResult struct { - Passwords *[]TokenPassword `json:"passwords,omitempty"` - Username *string `json:"username,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importimageparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importimageparameters.go deleted file mode 100644 index 87cf41482e0c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importimageparameters.go +++ /dev/null @@ -1,11 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImportImageParameters struct { - Mode *ImportMode `json:"mode,omitempty"` - Source ImportSource `json:"source"` - TargetTags *[]string `json:"targetTags,omitempty"` - UntaggedTargetRepositories *[]string `json:"untaggedTargetRepositories,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsource.go deleted file mode 100644 index 31af23446452..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsource.go +++ /dev/null @@ -1,11 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImportSource struct { - Credentials *ImportSourceCredentials `json:"credentials,omitempty"` - RegistryUri *string `json:"registryUri,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - SourceImage string `json:"sourceImage"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsourcecredentials.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsourcecredentials.go deleted file mode 100644 index 58089b0fb0d9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_importsourcecredentials.go +++ /dev/null @@ -1,9 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImportSourceCredentials struct { - Password string `json:"password"` - Username *string `json:"username,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_iprule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_iprule.go deleted file mode 100644 index dd326aa73f3f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_iprule.go +++ /dev/null @@ -1,9 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPRule struct { - Action *Action `json:"action,omitempty"` - Value string `json:"value"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_keyvaultproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_keyvaultproperties.go deleted file mode 100644 index 897c6dd8d9be..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_keyvaultproperties.go +++ /dev/null @@ -1,30 +0,0 @@ -package registries - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KeyVaultProperties struct { - Identity *string `json:"identity,omitempty"` - KeyIdentifier *string `json:"keyIdentifier,omitempty"` - KeyRotationEnabled *bool `json:"keyRotationEnabled,omitempty"` - LastKeyRotationTimestamp *string `json:"lastKeyRotationTimestamp,omitempty"` - VersionedKeyIdentifier *string `json:"versionedKeyIdentifier,omitempty"` -} - -func (o *KeyVaultProperties) GetLastKeyRotationTimestampAsTime() (*time.Time, error) { - if o.LastKeyRotationTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastKeyRotationTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *KeyVaultProperties) SetLastKeyRotationTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastKeyRotationTimestamp = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_networkruleset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_networkruleset.go deleted file mode 100644 index dec8b58f5ced..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_networkruleset.go +++ /dev/null @@ -1,9 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkRuleSet struct { - DefaultAction DefaultAction `json:"defaultAction"` - IPRules *[]IPRule `json:"ipRules,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_policies.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_policies.go deleted file mode 100644 index 87ff2bbd4ba5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_policies.go +++ /dev/null @@ -1,11 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Policies struct { - ExportPolicy *ExportPolicy `json:"exportPolicy,omitempty"` - QuarantinePolicy *QuarantinePolicy `json:"quarantinePolicy,omitempty"` - RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` - TrustPolicy *TrustPolicy `json:"trustPolicy,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpoint.go deleted file mode 100644 index 411a1e09e74f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpoint.go +++ /dev/null @@ -1,8 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpoint struct { - Id *string `json:"id,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnection.go deleted file mode 100644 index 788154720bc4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnection.go +++ /dev/null @@ -1,16 +0,0 @@ -package registries - -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 PrivateEndpointConnection struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnectionproperties.go deleted file mode 100644 index 4c8ee66a8799..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointConnectionProperties struct { - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresource.go deleted file mode 100644 index bd76ad62e194..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresource.go +++ /dev/null @@ -1,11 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResource struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresourceproperties.go deleted file mode 100644 index bc9bc51fac79..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkresourceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResourceProperties struct { - GroupId *string `json:"groupId,omitempty"` - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkserviceconnectionstate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 574d08caf189..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionState struct { - ActionsRequired *ActionsRequired `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *ConnectionStatus `json:"status,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_quarantinepolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_quarantinepolicy.go deleted file mode 100644 index 3d620232e941..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_quarantinepolicy.go +++ /dev/null @@ -1,8 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QuarantinePolicy struct { - Status *PolicyStatus `json:"status,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_regeneratecredentialparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_regeneratecredentialparameters.go deleted file mode 100644 index 755b01c4e9d2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_regeneratecredentialparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegenerateCredentialParameters struct { - Name PasswordName `json:"name"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registry.go deleted file mode 100644 index 5717ef0c63e9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registry.go +++ /dev/null @@ -1,21 +0,0 @@ -package registries - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-helpers/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 Registry struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *RegistryProperties `json:"properties,omitempty"` - Sku Sku `json:"sku"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrylistcredentialsresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrylistcredentialsresult.go deleted file mode 100644 index 73bbbf961384..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrylistcredentialsresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryListCredentialsResult struct { - Passwords *[]RegistryPassword `json:"passwords,omitempty"` - Username *string `json:"username,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypassword.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypassword.go deleted file mode 100644 index 774a3c4a0808..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypassword.go +++ /dev/null @@ -1,9 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryPassword struct { - Name *PasswordName `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryproperties.go deleted file mode 100644 index 403f470fc4ff..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryproperties.go +++ /dev/null @@ -1,39 +0,0 @@ -package registries - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryProperties struct { - AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` - CreationDate *string `json:"creationDate,omitempty"` - DataEndpointEnabled *bool `json:"dataEndpointEnabled,omitempty"` - DataEndpointHostNames *[]string `json:"dataEndpointHostNames,omitempty"` - Encryption *EncryptionProperty `json:"encryption,omitempty"` - LoginServer *string `json:"loginServer,omitempty"` - NetworkRuleBypassOptions *NetworkRuleBypassOptions `json:"networkRuleBypassOptions,omitempty"` - NetworkRuleSet *NetworkRuleSet `json:"networkRuleSet,omitempty"` - Policies *Policies `json:"policies,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - Status *Status `json:"status,omitempty"` - ZoneRedundancy *ZoneRedundancy `json:"zoneRedundancy,omitempty"` -} - -func (o *RegistryProperties) GetCreationDateAsTime() (*time.Time, error) { - if o.CreationDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreationDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *RegistryProperties) SetCreationDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreationDate = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypropertiesupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypropertiesupdateparameters.go deleted file mode 100644 index f96e73ff91d1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registrypropertiesupdateparameters.go +++ /dev/null @@ -1,14 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryPropertiesUpdateParameters struct { - AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` - DataEndpointEnabled *bool `json:"dataEndpointEnabled,omitempty"` - Encryption *EncryptionProperty `json:"encryption,omitempty"` - NetworkRuleBypassOptions *NetworkRuleBypassOptions `json:"networkRuleBypassOptions,omitempty"` - NetworkRuleSet *NetworkRuleSet `json:"networkRuleSet,omitempty"` - Policies *Policies `json:"policies,omitempty"` - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryupdateparameters.go deleted file mode 100644 index faaef3805a3b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryupdateparameters.go +++ /dev/null @@ -1,15 +0,0 @@ -package registries - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryUpdateParameters struct { - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Properties *RegistryPropertiesUpdateParameters `json:"properties,omitempty"` - Sku *Sku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusage.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusage.go deleted file mode 100644 index 360e66a853a7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusage.go +++ /dev/null @@ -1,11 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryUsage struct { - CurrentValue *int64 `json:"currentValue,omitempty"` - Limit *int64 `json:"limit,omitempty"` - Name *string `json:"name,omitempty"` - Unit *RegistryUsageUnit `json:"unit,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusagelistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusagelistresult.go deleted file mode 100644 index 34f8adfe2395..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_registryusagelistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryUsageListResult struct { - Value *[]RegistryUsage `json:"value,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_retentionpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_retentionpolicy.go deleted file mode 100644 index 1db918f10410..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_retentionpolicy.go +++ /dev/null @@ -1,28 +0,0 @@ -package registries - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicy struct { - Days *int64 `json:"days,omitempty"` - LastUpdatedTime *string `json:"lastUpdatedTime,omitempty"` - Status *PolicyStatus `json:"status,omitempty"` -} - -func (o *RetentionPolicy) GetLastUpdatedTimeAsTime() (*time.Time, error) { - if o.LastUpdatedTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *RetentionPolicy) SetLastUpdatedTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedTime = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_sku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_sku.go deleted file mode 100644 index 2b0fae22fea6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_sku.go +++ /dev/null @@ -1,9 +0,0 @@ -package registries - -// 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 SkuName `json:"name"` - Tier *SkuTier `json:"tier,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_status.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_status.go deleted file mode 100644 index 2d04c2f49b43..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_status.go +++ /dev/null @@ -1,28 +0,0 @@ -package registries - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Status struct { - DisplayStatus *string `json:"displayStatus,omitempty"` - Message *string `json:"message,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` -} - -func (o *Status) GetTimestampAsTime() (*time.Time, error) { - if o.Timestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *Status) SetTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Timestamp = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_tokenpassword.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_tokenpassword.go deleted file mode 100644 index 437fa0813f4c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_tokenpassword.go +++ /dev/null @@ -1,41 +0,0 @@ -package registries - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TokenPassword struct { - CreationTime *string `json:"creationTime,omitempty"` - Expiry *string `json:"expiry,omitempty"` - Name *TokenPasswordName `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -func (o *TokenPassword) GetCreationTimeAsTime() (*time.Time, error) { - if o.CreationTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *TokenPassword) SetCreationTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreationTime = &formatted -} - -func (o *TokenPassword) GetExpiryAsTime() (*time.Time, error) { - if o.Expiry == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Expiry, "2006-01-02T15:04:05Z07:00") -} - -func (o *TokenPassword) SetExpiryAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Expiry = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_trustpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_trustpolicy.go deleted file mode 100644 index 33b15d9cc34f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/model_trustpolicy.go +++ /dev/null @@ -1,9 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrustPolicy struct { - Status *PolicyStatus `json:"status,omitempty"` - Type *TrustPolicyType `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/predicates.go deleted file mode 100644 index 2fd7c4122608..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/predicates.go +++ /dev/null @@ -1,55 +0,0 @@ -package registries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResourceOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p PrivateLinkResourceOperationPredicate) Matches(input PrivateLinkResource) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} - -type RegistryOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p RegistryOperationPredicate) Matches(input Registry) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/version.go deleted file mode 100644 index 4bb3fc9fbc7f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package registries - -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 = "2023-07-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/registries/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/README.md deleted file mode 100644 index a972471d00c8..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/README.md +++ /dev/null @@ -1,99 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications` Documentation - -The `replications` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/replications" -``` - - -### Client Initialization - -```go -client := replications.NewReplicationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ReplicationsClient.Create` - -```go -ctx := context.TODO() -id := replications.NewReplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "replicationValue") - -payload := replications.Replication{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ReplicationsClient.Delete` - -```go -ctx := context.TODO() -id := replications.NewReplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "replicationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ReplicationsClient.Get` - -```go -ctx := context.TODO() -id := replications.NewReplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "replicationValue") - -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: `ReplicationsClient.List` - -```go -ctx := context.TODO() -id := replications.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -// alternatively `client.List(ctx, id)` can be used to do batched pagination -items, err := client.ListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ReplicationsClient.Update` - -```go -ctx := context.TODO() -id := replications.NewReplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "replicationValue") - -payload := replications.ReplicationUpdateParameters{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/client.go deleted file mode 100644 index 4cd118374acb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package replications - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationsClient struct { - Client *resourcemanager.Client -} - -func NewReplicationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ReplicationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "replications", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ReplicationsClient: %+v", err) - } - - return &ReplicationsClient{ - Client: client, - }, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/constants.go deleted file mode 100644 index 6161484bd735..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/constants.go +++ /dev/null @@ -1,104 +0,0 @@ -package replications - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ProvisioningState string - -const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type ZoneRedundancy string - -const ( - ZoneRedundancyDisabled ZoneRedundancy = "Disabled" - ZoneRedundancyEnabled ZoneRedundancy = "Enabled" -) - -func PossibleValuesForZoneRedundancy() []string { - return []string{ - string(ZoneRedundancyDisabled), - string(ZoneRedundancyEnabled), - } -} - -func (s *ZoneRedundancy) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseZoneRedundancy(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseZoneRedundancy(input string) (*ZoneRedundancy, error) { - vals := map[string]ZoneRedundancy{ - "disabled": ZoneRedundancyDisabled, - "enabled": ZoneRedundancyEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ZoneRedundancy(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_registry.go deleted file mode 100644 index 5aa993ef70cd..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_registry.go +++ /dev/null @@ -1,130 +0,0 @@ -package replications - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&RegistryId{}) -} - -var _ resourceids.ResourceId = &RegistryId{} - -// RegistryId is a struct representing the Resource ID for a Registry -type RegistryId struct { - SubscriptionId string - ResourceGroupName string - RegistryName string -} - -// NewRegistryID returns a new RegistryId struct -func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { - return RegistryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RegistryName: registryName, - } -} - -// ParseRegistryID parses 'input' into a RegistryId -func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegistryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId -// note: this method should only be used for API response data and not user input -func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegistryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RegistryName, ok = input.Parsed["registryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) - } - - return nil -} - -// ValidateRegistryID checks that 'input' can be parsed as a Registry ID -func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Registry ID -func (id RegistryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Registry ID -func (id RegistryId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), - resourceids.StaticSegment("staticRegistries", "registries", "registries"), - resourceids.UserSpecifiedSegment("registryName", "registryValue"), - } -} - -// String returns a human-readable description of this Registry ID -func (id RegistryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Registry Name: %q", id.RegistryName), - } - return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_replication.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_replication.go deleted file mode 100644 index 604cae9aead2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/id_replication.go +++ /dev/null @@ -1,139 +0,0 @@ -package replications - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&ReplicationId{}) -} - -var _ resourceids.ResourceId = &ReplicationId{} - -// ReplicationId is a struct representing the Resource ID for a Replication -type ReplicationId struct { - SubscriptionId string - ResourceGroupName string - RegistryName string - ReplicationName string -} - -// NewReplicationID returns a new ReplicationId struct -func NewReplicationID(subscriptionId string, resourceGroupName string, registryName string, replicationName string) ReplicationId { - return ReplicationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RegistryName: registryName, - ReplicationName: replicationName, - } -} - -// ParseReplicationID parses 'input' into a ReplicationId -func ParseReplicationID(input string) (*ReplicationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ReplicationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ReplicationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseReplicationIDInsensitively parses 'input' case-insensitively into a ReplicationId -// note: this method should only be used for API response data and not user input -func ParseReplicationIDInsensitively(input string) (*ReplicationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ReplicationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ReplicationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ReplicationId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RegistryName, ok = input.Parsed["registryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) - } - - if id.ReplicationName, ok = input.Parsed["replicationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "replicationName", input) - } - - return nil -} - -// ValidateReplicationID checks that 'input' can be parsed as a Replication ID -func ValidateReplicationID(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 := ParseReplicationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Replication ID -func (id ReplicationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/replications/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.ReplicationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Replication ID -func (id ReplicationId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), - resourceids.StaticSegment("staticRegistries", "registries", "registries"), - resourceids.UserSpecifiedSegment("registryName", "registryValue"), - resourceids.StaticSegment("staticReplications", "replications", "replications"), - resourceids.UserSpecifiedSegment("replicationName", "replicationValue"), - } -} - -// String returns a human-readable description of this Replication ID -func (id ReplicationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Registry Name: %q", id.RegistryName), - fmt.Sprintf("Replication Name: %q", id.ReplicationName), - } - return fmt.Sprintf("Replication (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_create.go deleted file mode 100644 index f591043caae1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_create.go +++ /dev/null @@ -1,75 +0,0 @@ -package replications - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Replication -} - -// Create ... -func (c ReplicationsClient) Create(ctx context.Context, id ReplicationId, input Replication) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c ReplicationsClient) CreateThenPoll(ctx context.Context, id ReplicationId, input Replication) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_delete.go deleted file mode 100644 index 29cc8f8370a9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package replications - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c ReplicationsClient) Delete(ctx context.Context, id ReplicationId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c ReplicationsClient) DeleteThenPoll(ctx context.Context, id ReplicationId) error { - result, err := c.Delete(ctx, id) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_get.go deleted file mode 100644 index 13be12c7ca15..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package replications - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Replication -} - -// Get ... -func (c ReplicationsClient) Get(ctx context.Context, id ReplicationId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model Replication - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_list.go deleted file mode 100644 index d1c02bf7ce85..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package replications - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Replication -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Replication -} - -// List ... -func (c ReplicationsClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/replications", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]Replication `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListComplete retrieves all the results into a single object -func (c ReplicationsClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ReplicationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ReplicationsClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate ReplicationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Replication, 0) - - resp, err := c.List(ctx, id) - if err != nil { - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_update.go deleted file mode 100644 index 329dc24b1632..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package replications - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Replication -} - -// Update ... -func (c ReplicationsClient) Update(ctx context.Context, id ReplicationId, input ReplicationUpdateParameters) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c ReplicationsClient) UpdateThenPoll(ctx context.Context, id ReplicationId, input ReplicationUpdateParameters) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replication.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replication.go deleted file mode 100644 index 932be700cb9e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replication.go +++ /dev/null @@ -1,18 +0,0 @@ -package replications - -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 Replication struct { - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *ReplicationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationproperties.go deleted file mode 100644 index 3f63c28dc2b9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package replications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationProperties struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RegionEndpointEnabled *bool `json:"regionEndpointEnabled,omitempty"` - Status *Status `json:"status,omitempty"` - ZoneRedundancy *ZoneRedundancy `json:"zoneRedundancy,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparameters.go deleted file mode 100644 index 828a1fbc4ab2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package replications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationUpdateParameters struct { - Properties *ReplicationUpdateParametersProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparametersproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparametersproperties.go deleted file mode 100644 index 856e3b415ffc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_replicationupdateparametersproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package replications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationUpdateParametersProperties struct { - RegionEndpointEnabled *bool `json:"regionEndpointEnabled,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_status.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_status.go deleted file mode 100644 index 0e6acd8d6afb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/model_status.go +++ /dev/null @@ -1,28 +0,0 @@ -package replications - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Status struct { - DisplayStatus *string `json:"displayStatus,omitempty"` - Message *string `json:"message,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` -} - -func (o *Status) GetTimestampAsTime() (*time.Time, error) { - if o.Timestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *Status) SetTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Timestamp = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/predicates.go deleted file mode 100644 index fbba0b6c312e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package replications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p ReplicationOperationPredicate) Matches(input Replication) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/version.go deleted file mode 100644 index 9d09e1d982cc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package replications - -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 = "2023-07-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/replications/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/README.md deleted file mode 100644 index d5bb9fb12136..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/README.md +++ /dev/null @@ -1,99 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps` Documentation - -The `scopemaps` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/scopemaps" -``` - - -### Client Initialization - -```go -client := scopemaps.NewScopeMapsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ScopeMapsClient.Create` - -```go -ctx := context.TODO() -id := scopemaps.NewScopeMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "scopeMapValue") - -payload := scopemaps.ScopeMap{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ScopeMapsClient.Delete` - -```go -ctx := context.TODO() -id := scopemaps.NewScopeMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "scopeMapValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ScopeMapsClient.Get` - -```go -ctx := context.TODO() -id := scopemaps.NewScopeMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "scopeMapValue") - -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: `ScopeMapsClient.List` - -```go -ctx := context.TODO() -id := scopemaps.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -// alternatively `client.List(ctx, id)` can be used to do batched pagination -items, err := client.ListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ScopeMapsClient.Update` - -```go -ctx := context.TODO() -id := scopemaps.NewScopeMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "scopeMapValue") - -payload := scopemaps.ScopeMapUpdateParameters{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/client.go deleted file mode 100644 index a5ac7bcecec3..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package scopemaps - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopeMapsClient struct { - Client *resourcemanager.Client -} - -func NewScopeMapsClientWithBaseURI(sdkApi sdkEnv.Api) (*ScopeMapsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "scopemaps", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ScopeMapsClient: %+v", err) - } - - return &ScopeMapsClient{ - Client: client, - }, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/constants.go deleted file mode 100644 index a3cdf65bba18..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/constants.go +++ /dev/null @@ -1,63 +0,0 @@ -package scopemaps - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ProvisioningState string - -const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_registry.go deleted file mode 100644 index 185bfc9501d1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_registry.go +++ /dev/null @@ -1,130 +0,0 @@ -package scopemaps - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&RegistryId{}) -} - -var _ resourceids.ResourceId = &RegistryId{} - -// RegistryId is a struct representing the Resource ID for a Registry -type RegistryId struct { - SubscriptionId string - ResourceGroupName string - RegistryName string -} - -// NewRegistryID returns a new RegistryId struct -func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { - return RegistryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RegistryName: registryName, - } -} - -// ParseRegistryID parses 'input' into a RegistryId -func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegistryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId -// note: this method should only be used for API response data and not user input -func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegistryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RegistryName, ok = input.Parsed["registryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) - } - - return nil -} - -// ValidateRegistryID checks that 'input' can be parsed as a Registry ID -func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Registry ID -func (id RegistryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Registry ID -func (id RegistryId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), - resourceids.StaticSegment("staticRegistries", "registries", "registries"), - resourceids.UserSpecifiedSegment("registryName", "registryValue"), - } -} - -// String returns a human-readable description of this Registry ID -func (id RegistryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Registry Name: %q", id.RegistryName), - } - return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_scopemap.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_scopemap.go deleted file mode 100644 index f70441f715a7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/id_scopemap.go +++ /dev/null @@ -1,139 +0,0 @@ -package scopemaps - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&ScopeMapId{}) -} - -var _ resourceids.ResourceId = &ScopeMapId{} - -// ScopeMapId is a struct representing the Resource ID for a Scope Map -type ScopeMapId struct { - SubscriptionId string - ResourceGroupName string - RegistryName string - ScopeMapName string -} - -// NewScopeMapID returns a new ScopeMapId struct -func NewScopeMapID(subscriptionId string, resourceGroupName string, registryName string, scopeMapName string) ScopeMapId { - return ScopeMapId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RegistryName: registryName, - ScopeMapName: scopeMapName, - } -} - -// ParseScopeMapID parses 'input' into a ScopeMapId -func ParseScopeMapID(input string) (*ScopeMapId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopeMapId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopeMapId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopeMapIDInsensitively parses 'input' case-insensitively into a ScopeMapId -// note: this method should only be used for API response data and not user input -func ParseScopeMapIDInsensitively(input string) (*ScopeMapId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopeMapId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopeMapId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopeMapId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RegistryName, ok = input.Parsed["registryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) - } - - if id.ScopeMapName, ok = input.Parsed["scopeMapName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scopeMapName", input) - } - - return nil -} - -// ValidateScopeMapID checks that 'input' can be parsed as a Scope Map ID -func ValidateScopeMapID(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 := ParseScopeMapID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scope Map ID -func (id ScopeMapId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/scopeMaps/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.ScopeMapName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scope Map ID -func (id ScopeMapId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), - resourceids.StaticSegment("staticRegistries", "registries", "registries"), - resourceids.UserSpecifiedSegment("registryName", "registryValue"), - resourceids.StaticSegment("staticScopeMaps", "scopeMaps", "scopeMaps"), - resourceids.UserSpecifiedSegment("scopeMapName", "scopeMapValue"), - } -} - -// String returns a human-readable description of this Scope Map ID -func (id ScopeMapId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Registry Name: %q", id.RegistryName), - fmt.Sprintf("Scope Map Name: %q", id.ScopeMapName), - } - return fmt.Sprintf("Scope Map (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_create.go deleted file mode 100644 index d85a26ae4ccb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_create.go +++ /dev/null @@ -1,75 +0,0 @@ -package scopemaps - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ScopeMap -} - -// Create ... -func (c ScopeMapsClient) Create(ctx context.Context, id ScopeMapId, input ScopeMap) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c ScopeMapsClient) CreateThenPoll(ctx context.Context, id ScopeMapId, input ScopeMap) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_delete.go deleted file mode 100644 index 6a6cd2fa49b2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package scopemaps - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c ScopeMapsClient) Delete(ctx context.Context, id ScopeMapId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c ScopeMapsClient) DeleteThenPoll(ctx context.Context, id ScopeMapId) error { - result, err := c.Delete(ctx, id) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_get.go deleted file mode 100644 index 48e684aa402e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package scopemaps - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ScopeMap -} - -// Get ... -func (c ScopeMapsClient) Get(ctx context.Context, id ScopeMapId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model ScopeMap - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_list.go deleted file mode 100644 index b27ad5219423..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package scopemaps - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ScopeMap -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ScopeMap -} - -// List ... -func (c ScopeMapsClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/scopeMaps", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]ScopeMap `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListComplete retrieves all the results into a single object -func (c ScopeMapsClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ScopeMapOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ScopeMapsClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate ScopeMapOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ScopeMap, 0) - - resp, err := c.List(ctx, id) - if err != nil { - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_update.go deleted file mode 100644 index 5ca984a76ad1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package scopemaps - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ScopeMap -} - -// Update ... -func (c ScopeMapsClient) Update(ctx context.Context, id ScopeMapId, input ScopeMapUpdateParameters) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c ScopeMapsClient) UpdateThenPoll(ctx context.Context, id ScopeMapId, input ScopeMapUpdateParameters) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemap.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemap.go deleted file mode 100644 index 844e87fc8140..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemap.go +++ /dev/null @@ -1,16 +0,0 @@ -package scopemaps - -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 ScopeMap struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ScopeMapProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapproperties.go deleted file mode 100644 index 52d2be4afcf5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapproperties.go +++ /dev/null @@ -1,30 +0,0 @@ -package scopemaps - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopeMapProperties struct { - Actions []string `json:"actions"` - CreationDate *string `json:"creationDate,omitempty"` - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Type *string `json:"type,omitempty"` -} - -func (o *ScopeMapProperties) GetCreationDateAsTime() (*time.Time, error) { - if o.CreationDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreationDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScopeMapProperties) SetCreationDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreationDate = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemappropertiesupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemappropertiesupdateparameters.go deleted file mode 100644 index fb7304188c92..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemappropertiesupdateparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package scopemaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopeMapPropertiesUpdateParameters struct { - Actions *[]string `json:"actions,omitempty"` - Description *string `json:"description,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapupdateparameters.go deleted file mode 100644 index d735edef15dc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/model_scopemapupdateparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package scopemaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopeMapUpdateParameters struct { - Properties *ScopeMapPropertiesUpdateParameters `json:"properties,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/predicates.go deleted file mode 100644 index 7ea335c428ca..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package scopemaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopeMapOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ScopeMapOperationPredicate) Matches(input ScopeMap) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/version.go deleted file mode 100644 index 567a42d9286d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package scopemaps - -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 = "2023-07-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/scopemaps/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/README.md deleted file mode 100644 index 35c41d68b72a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/README.md +++ /dev/null @@ -1,99 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens` Documentation - -The `tokens` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/tokens" -``` - - -### Client Initialization - -```go -client := tokens.NewTokensClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `TokensClient.Create` - -```go -ctx := context.TODO() -id := tokens.NewTokenID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "tokenValue") - -payload := tokens.Token{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `TokensClient.Delete` - -```go -ctx := context.TODO() -id := tokens.NewTokenID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "tokenValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `TokensClient.Get` - -```go -ctx := context.TODO() -id := tokens.NewTokenID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "tokenValue") - -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: `TokensClient.List` - -```go -ctx := context.TODO() -id := tokens.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -// alternatively `client.List(ctx, id)` can be used to do batched pagination -items, err := client.ListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `TokensClient.Update` - -```go -ctx := context.TODO() -id := tokens.NewTokenID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "tokenValue") - -payload := tokens.TokenUpdateParameters{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/client.go deleted file mode 100644 index 11f08be868cb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package tokens - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TokensClient struct { - Client *resourcemanager.Client -} - -func NewTokensClientWithBaseURI(sdkApi sdkEnv.Api) (*TokensClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "tokens", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating TokensClient: %+v", err) - } - - return &TokensClient{ - Client: client, - }, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/constants.go deleted file mode 100644 index 85997819ca3f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/constants.go +++ /dev/null @@ -1,186 +0,0 @@ -package tokens - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ProvisioningState string - -const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type TokenCertificateName string - -const ( - TokenCertificateNameCertificateOne TokenCertificateName = "certificate1" - TokenCertificateNameCertificateTwo TokenCertificateName = "certificate2" -) - -func PossibleValuesForTokenCertificateName() []string { - return []string{ - string(TokenCertificateNameCertificateOne), - string(TokenCertificateNameCertificateTwo), - } -} - -func (s *TokenCertificateName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTokenCertificateName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTokenCertificateName(input string) (*TokenCertificateName, error) { - vals := map[string]TokenCertificateName{ - "certificate1": TokenCertificateNameCertificateOne, - "certificate2": TokenCertificateNameCertificateTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TokenCertificateName(input) - return &out, nil -} - -type TokenPasswordName string - -const ( - TokenPasswordNamePasswordOne TokenPasswordName = "password1" - TokenPasswordNamePasswordTwo TokenPasswordName = "password2" -) - -func PossibleValuesForTokenPasswordName() []string { - return []string{ - string(TokenPasswordNamePasswordOne), - string(TokenPasswordNamePasswordTwo), - } -} - -func (s *TokenPasswordName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTokenPasswordName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTokenPasswordName(input string) (*TokenPasswordName, error) { - vals := map[string]TokenPasswordName{ - "password1": TokenPasswordNamePasswordOne, - "password2": TokenPasswordNamePasswordTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TokenPasswordName(input) - return &out, nil -} - -type TokenStatus string - -const ( - TokenStatusDisabled TokenStatus = "disabled" - TokenStatusEnabled TokenStatus = "enabled" -) - -func PossibleValuesForTokenStatus() []string { - return []string{ - string(TokenStatusDisabled), - string(TokenStatusEnabled), - } -} - -func (s *TokenStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTokenStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTokenStatus(input string) (*TokenStatus, error) { - vals := map[string]TokenStatus{ - "disabled": TokenStatusDisabled, - "enabled": TokenStatusEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TokenStatus(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_registry.go deleted file mode 100644 index fda07a2cc32d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_registry.go +++ /dev/null @@ -1,130 +0,0 @@ -package tokens - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&RegistryId{}) -} - -var _ resourceids.ResourceId = &RegistryId{} - -// RegistryId is a struct representing the Resource ID for a Registry -type RegistryId struct { - SubscriptionId string - ResourceGroupName string - RegistryName string -} - -// NewRegistryID returns a new RegistryId struct -func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { - return RegistryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RegistryName: registryName, - } -} - -// ParseRegistryID parses 'input' into a RegistryId -func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegistryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId -// note: this method should only be used for API response data and not user input -func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegistryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RegistryName, ok = input.Parsed["registryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) - } - - return nil -} - -// ValidateRegistryID checks that 'input' can be parsed as a Registry ID -func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Registry ID -func (id RegistryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Registry ID -func (id RegistryId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), - resourceids.StaticSegment("staticRegistries", "registries", "registries"), - resourceids.UserSpecifiedSegment("registryName", "registryValue"), - } -} - -// String returns a human-readable description of this Registry ID -func (id RegistryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Registry Name: %q", id.RegistryName), - } - return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_token.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_token.go deleted file mode 100644 index af095b01bde2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/id_token.go +++ /dev/null @@ -1,139 +0,0 @@ -package tokens - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&TokenId{}) -} - -var _ resourceids.ResourceId = &TokenId{} - -// TokenId is a struct representing the Resource ID for a Token -type TokenId struct { - SubscriptionId string - ResourceGroupName string - RegistryName string - TokenName string -} - -// NewTokenID returns a new TokenId struct -func NewTokenID(subscriptionId string, resourceGroupName string, registryName string, tokenName string) TokenId { - return TokenId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RegistryName: registryName, - TokenName: tokenName, - } -} - -// ParseTokenID parses 'input' into a TokenId -func ParseTokenID(input string) (*TokenId, error) { - parser := resourceids.NewParserFromResourceIdType(&TokenId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := TokenId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseTokenIDInsensitively parses 'input' case-insensitively into a TokenId -// note: this method should only be used for API response data and not user input -func ParseTokenIDInsensitively(input string) (*TokenId, error) { - parser := resourceids.NewParserFromResourceIdType(&TokenId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := TokenId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *TokenId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RegistryName, ok = input.Parsed["registryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) - } - - if id.TokenName, ok = input.Parsed["tokenName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "tokenName", input) - } - - return nil -} - -// ValidateTokenID checks that 'input' can be parsed as a Token ID -func ValidateTokenID(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 := ParseTokenID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Token ID -func (id TokenId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/tokens/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.TokenName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Token ID -func (id TokenId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), - resourceids.StaticSegment("staticRegistries", "registries", "registries"), - resourceids.UserSpecifiedSegment("registryName", "registryValue"), - resourceids.StaticSegment("staticTokens", "tokens", "tokens"), - resourceids.UserSpecifiedSegment("tokenName", "tokenValue"), - } -} - -// String returns a human-readable description of this Token ID -func (id TokenId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Registry Name: %q", id.RegistryName), - fmt.Sprintf("Token Name: %q", id.TokenName), - } - return fmt.Sprintf("Token (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_create.go deleted file mode 100644 index acafb7916a61..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_create.go +++ /dev/null @@ -1,75 +0,0 @@ -package tokens - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Token -} - -// Create ... -func (c TokensClient) Create(ctx context.Context, id TokenId, input Token) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c TokensClient) CreateThenPoll(ctx context.Context, id TokenId, input Token) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_delete.go deleted file mode 100644 index 7ed822bf15b4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package tokens - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c TokensClient) Delete(ctx context.Context, id TokenId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c TokensClient) DeleteThenPoll(ctx context.Context, id TokenId) error { - result, err := c.Delete(ctx, id) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_get.go deleted file mode 100644 index d7c6df407ba8..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package tokens - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Token -} - -// Get ... -func (c TokensClient) Get(ctx context.Context, id TokenId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model Token - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_list.go deleted file mode 100644 index 3fcd9ecad729..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package tokens - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Token -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Token -} - -// List ... -func (c TokensClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/tokens", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]Token `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListComplete retrieves all the results into a single object -func (c TokensClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, TokenOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c TokensClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate TokenOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Token, 0) - - resp, err := c.List(ctx, id) - if err != nil { - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_update.go deleted file mode 100644 index a6865eadc35e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package tokens - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Token -} - -// Update ... -func (c TokensClient) Update(ctx context.Context, id TokenId, input TokenUpdateParameters) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c TokensClient) UpdateThenPoll(ctx context.Context, id TokenId, input TokenUpdateParameters) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_token.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_token.go deleted file mode 100644 index c459084be8ed..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_token.go +++ /dev/null @@ -1,16 +0,0 @@ -package tokens - -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 Token struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *TokenProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencertificate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencertificate.go deleted file mode 100644 index 8e4a5d3cde7a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencertificate.go +++ /dev/null @@ -1,29 +0,0 @@ -package tokens - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TokenCertificate struct { - EncodedPemCertificate *string `json:"encodedPemCertificate,omitempty"` - Expiry *string `json:"expiry,omitempty"` - Name *TokenCertificateName `json:"name,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` -} - -func (o *TokenCertificate) GetExpiryAsTime() (*time.Time, error) { - if o.Expiry == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Expiry, "2006-01-02T15:04:05Z07:00") -} - -func (o *TokenCertificate) SetExpiryAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Expiry = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencredentialsproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencredentialsproperties.go deleted file mode 100644 index de0203f7e63e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokencredentialsproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package tokens - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TokenCredentialsProperties struct { - Certificates *[]TokenCertificate `json:"certificates,omitempty"` - Passwords *[]TokenPassword `json:"passwords,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenpassword.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenpassword.go deleted file mode 100644 index f46a71eab86c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenpassword.go +++ /dev/null @@ -1,41 +0,0 @@ -package tokens - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TokenPassword struct { - CreationTime *string `json:"creationTime,omitempty"` - Expiry *string `json:"expiry,omitempty"` - Name *TokenPasswordName `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -func (o *TokenPassword) GetCreationTimeAsTime() (*time.Time, error) { - if o.CreationTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *TokenPassword) SetCreationTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreationTime = &formatted -} - -func (o *TokenPassword) GetExpiryAsTime() (*time.Time, error) { - if o.Expiry == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Expiry, "2006-01-02T15:04:05Z07:00") -} - -func (o *TokenPassword) SetExpiryAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Expiry = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenproperties.go deleted file mode 100644 index a2f60da2fa52..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenproperties.go +++ /dev/null @@ -1,30 +0,0 @@ -package tokens - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TokenProperties struct { - CreationDate *string `json:"creationDate,omitempty"` - Credentials *TokenCredentialsProperties `json:"credentials,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ScopeMapId *string `json:"scopeMapId,omitempty"` - Status *TokenStatus `json:"status,omitempty"` -} - -func (o *TokenProperties) GetCreationDateAsTime() (*time.Time, error) { - if o.CreationDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreationDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *TokenProperties) SetCreationDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreationDate = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateparameters.go deleted file mode 100644 index 3a13b6690786..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package tokens - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TokenUpdateParameters struct { - Properties *TokenUpdateProperties `json:"properties,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateproperties.go deleted file mode 100644 index c02a611e1cd5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/model_tokenupdateproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package tokens - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TokenUpdateProperties struct { - Credentials *TokenCredentialsProperties `json:"credentials,omitempty"` - ScopeMapId *string `json:"scopeMapId,omitempty"` - Status *TokenStatus `json:"status,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/predicates.go deleted file mode 100644 index e76d969798d3..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package tokens - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TokenOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p TokenOperationPredicate) Matches(input Token) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/version.go deleted file mode 100644 index 9b11230b9b84..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package tokens - -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 = "2023-07-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/tokens/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/README.md deleted file mode 100644 index 201c6990d07b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/README.md +++ /dev/null @@ -1,148 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks` Documentation - -The `webhooks` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/webhooks" -``` - - -### Client Initialization - -```go -client := webhooks.NewWebHooksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `WebHooksClient.Create` - -```go -ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue") - -payload := webhooks.WebhookCreateParameters{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `WebHooksClient.Delete` - -```go -ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `WebHooksClient.Get` - -```go -ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue") - -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: `WebHooksClient.GetCallbackConfig` - -```go -ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue") - -read, err := client.GetCallbackConfig(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `WebHooksClient.List` - -```go -ctx := context.TODO() -id := webhooks.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") - -// alternatively `client.List(ctx, id)` can be used to do batched pagination -items, err := client.ListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `WebHooksClient.ListEvents` - -```go -ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue") - -// alternatively `client.ListEvents(ctx, id)` can be used to do batched pagination -items, err := client.ListEventsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `WebHooksClient.Ping` - -```go -ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue") - -read, err := client.Ping(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `WebHooksClient.Update` - -```go -ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "webHookValue") - -payload := webhooks.WebhookUpdateParameters{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/client.go deleted file mode 100644 index b5da8564ffd9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package webhooks - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebHooksClient struct { - Client *resourcemanager.Client -} - -func NewWebHooksClientWithBaseURI(sdkApi sdkEnv.Api) (*WebHooksClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "webhooks", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating WebHooksClient: %+v", err) - } - - return &WebHooksClient{ - Client: client, - }, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/constants.go deleted file mode 100644 index 8da25bd4a152..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/constants.go +++ /dev/null @@ -1,154 +0,0 @@ -package webhooks - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ProvisioningState string - -const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type WebhookAction string - -const ( - WebhookActionChartDelete WebhookAction = "chart_delete" - WebhookActionChartPush WebhookAction = "chart_push" - WebhookActionDelete WebhookAction = "delete" - WebhookActionPush WebhookAction = "push" - WebhookActionQuarantine WebhookAction = "quarantine" -) - -func PossibleValuesForWebhookAction() []string { - return []string{ - string(WebhookActionChartDelete), - string(WebhookActionChartPush), - string(WebhookActionDelete), - string(WebhookActionPush), - string(WebhookActionQuarantine), - } -} - -func (s *WebhookAction) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebhookAction(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebhookAction(input string) (*WebhookAction, error) { - vals := map[string]WebhookAction{ - "chart_delete": WebhookActionChartDelete, - "chart_push": WebhookActionChartPush, - "delete": WebhookActionDelete, - "push": WebhookActionPush, - "quarantine": WebhookActionQuarantine, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebhookAction(input) - return &out, nil -} - -type WebhookStatus string - -const ( - WebhookStatusDisabled WebhookStatus = "disabled" - WebhookStatusEnabled WebhookStatus = "enabled" -) - -func PossibleValuesForWebhookStatus() []string { - return []string{ - string(WebhookStatusDisabled), - string(WebhookStatusEnabled), - } -} - -func (s *WebhookStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebhookStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebhookStatus(input string) (*WebhookStatus, error) { - vals := map[string]WebhookStatus{ - "disabled": WebhookStatusDisabled, - "enabled": WebhookStatusEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebhookStatus(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_registry.go deleted file mode 100644 index c878a6063dc6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_registry.go +++ /dev/null @@ -1,130 +0,0 @@ -package webhooks - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&RegistryId{}) -} - -var _ resourceids.ResourceId = &RegistryId{} - -// RegistryId is a struct representing the Resource ID for a Registry -type RegistryId struct { - SubscriptionId string - ResourceGroupName string - RegistryName string -} - -// NewRegistryID returns a new RegistryId struct -func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { - return RegistryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RegistryName: registryName, - } -} - -// ParseRegistryID parses 'input' into a RegistryId -func ParseRegistryID(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegistryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId -// note: this method should only be used for API response data and not user input -func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegistryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RegistryName, ok = input.Parsed["registryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) - } - - return nil -} - -// ValidateRegistryID checks that 'input' can be parsed as a Registry ID -func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Registry ID -func (id RegistryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Registry ID -func (id RegistryId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), - resourceids.StaticSegment("staticRegistries", "registries", "registries"), - resourceids.UserSpecifiedSegment("registryName", "registryValue"), - } -} - -// String returns a human-readable description of this Registry ID -func (id RegistryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Registry Name: %q", id.RegistryName), - } - return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go deleted file mode 100644 index 72e5710069e4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go +++ /dev/null @@ -1,139 +0,0 @@ -package webhooks - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&WebHookId{}) -} - -var _ resourceids.ResourceId = &WebHookId{} - -// WebHookId is a struct representing the Resource ID for a Web Hook -type WebHookId struct { - SubscriptionId string - ResourceGroupName string - RegistryName string - WebHookName string -} - -// NewWebHookID returns a new WebHookId struct -func NewWebHookID(subscriptionId string, resourceGroupName string, registryName string, webHookName string) WebHookId { - return WebHookId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RegistryName: registryName, - WebHookName: webHookName, - } -} - -// ParseWebHookID parses 'input' into a WebHookId -func ParseWebHookID(input string) (*WebHookId, error) { - parser := resourceids.NewParserFromResourceIdType(&WebHookId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WebHookId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWebHookIDInsensitively parses 'input' case-insensitively into a WebHookId -// note: this method should only be used for API response data and not user input -func ParseWebHookIDInsensitively(input string) (*WebHookId, error) { - parser := resourceids.NewParserFromResourceIdType(&WebHookId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WebHookId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WebHookId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RegistryName, ok = input.Parsed["registryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) - } - - if id.WebHookName, ok = input.Parsed["webHookName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "webHookName", input) - } - - return nil -} - -// ValidateWebHookID checks that 'input' can be parsed as a Web Hook ID -func ValidateWebHookID(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 := ParseWebHookID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Web Hook ID -func (id WebHookId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/webHooks/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.WebHookName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Web Hook ID -func (id WebHookId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), - resourceids.StaticSegment("staticRegistries", "registries", "registries"), - resourceids.UserSpecifiedSegment("registryName", "registryValue"), - resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), - resourceids.UserSpecifiedSegment("webHookName", "webHookValue"), - } -} - -// String returns a human-readable description of this Web Hook ID -func (id WebHookId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Registry Name: %q", id.RegistryName), - fmt.Sprintf("Web Hook Name: %q", id.WebHookName), - } - return fmt.Sprintf("Web Hook (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_create.go deleted file mode 100644 index 03efa380344f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_create.go +++ /dev/null @@ -1,75 +0,0 @@ -package webhooks - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Webhook -} - -// Create ... -func (c WebHooksClient) Create(ctx context.Context, id WebHookId, input WebhookCreateParameters) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c WebHooksClient) CreateThenPoll(ctx context.Context, id WebHookId, input WebhookCreateParameters) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_delete.go deleted file mode 100644 index 0ec1675fc794..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package webhooks - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c WebHooksClient) Delete(ctx context.Context, id WebHookId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c WebHooksClient) DeleteThenPoll(ctx context.Context, id WebHookId) error { - result, err := c.Delete(ctx, id) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_get.go deleted file mode 100644 index e89ea9db5db2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package webhooks - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Webhook -} - -// Get ... -func (c WebHooksClient) Get(ctx context.Context, id WebHookId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model Webhook - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_getcallbackconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_getcallbackconfig.go deleted file mode 100644 index 17146c00e680..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_getcallbackconfig.go +++ /dev/null @@ -1,55 +0,0 @@ -package webhooks - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetCallbackConfigOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CallbackConfig -} - -// GetCallbackConfig ... -func (c WebHooksClient) GetCallbackConfig(ctx context.Context, id WebHookId) (result GetCallbackConfigOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getCallbackConfig", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model CallbackConfig - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_list.go deleted file mode 100644 index 4435c866b302..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package webhooks - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Webhook -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Webhook -} - -// List ... -func (c WebHooksClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/webHooks", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]Webhook `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListComplete retrieves all the results into a single object -func (c WebHooksClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, WebhookOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WebHooksClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate WebhookOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Webhook, 0) - - resp, err := c.List(ctx, id) - if err != nil { - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_listevents.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_listevents.go deleted file mode 100644 index 401daa1e86f0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_listevents.go +++ /dev/null @@ -1,91 +0,0 @@ -package webhooks - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListEventsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Event -} - -type ListEventsCompleteResult struct { - LatestHttpResponse *http.Response - Items []Event -} - -// ListEvents ... -func (c WebHooksClient) ListEvents(ctx context.Context, id WebHookId) (result ListEventsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listEvents", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]Event `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListEventsComplete retrieves all the results into a single object -func (c WebHooksClient) ListEventsComplete(ctx context.Context, id WebHookId) (ListEventsCompleteResult, error) { - return c.ListEventsCompleteMatchingPredicate(ctx, id, EventOperationPredicate{}) -} - -// ListEventsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WebHooksClient) ListEventsCompleteMatchingPredicate(ctx context.Context, id WebHookId, predicate EventOperationPredicate) (result ListEventsCompleteResult, err error) { - items := make([]Event, 0) - - resp, err := c.ListEvents(ctx, id) - if err != nil { - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListEventsCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_ping.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_ping.go deleted file mode 100644 index 04e4ef1fde73..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_ping.go +++ /dev/null @@ -1,55 +0,0 @@ -package webhooks - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PingOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *EventInfo -} - -// Ping ... -func (c WebHooksClient) Ping(ctx context.Context, id WebHookId) (result PingOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/ping", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model EventInfo - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_update.go deleted file mode 100644 index 99522fc1d577..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package webhooks - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Webhook -} - -// Update ... -func (c WebHooksClient) Update(ctx context.Context, id WebHookId, input WebhookUpdateParameters) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c WebHooksClient) UpdateThenPoll(ctx context.Context, id WebHookId, input WebhookUpdateParameters) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_actor.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_actor.go deleted file mode 100644 index 76f36dcfea3c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_actor.go +++ /dev/null @@ -1,8 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Actor struct { - Name *string `json:"name,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_callbackconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_callbackconfig.go deleted file mode 100644 index 70c51edd7424..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_callbackconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CallbackConfig struct { - CustomHeaders *map[string]string `json:"customHeaders,omitempty"` - ServiceUri string `json:"serviceUri"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_event.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_event.go deleted file mode 100644 index 485b94a1cde6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_event.go +++ /dev/null @@ -1,10 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Event struct { - EventRequestMessage *EventRequestMessage `json:"eventRequestMessage,omitempty"` - EventResponseMessage *EventResponseMessage `json:"eventResponseMessage,omitempty"` - Id *string `json:"id,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventcontent.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventcontent.go deleted file mode 100644 index ea6b275bec2e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventcontent.go +++ /dev/null @@ -1,32 +0,0 @@ -package webhooks - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EventContent struct { - Action *string `json:"action,omitempty"` - Actor *Actor `json:"actor,omitempty"` - Id *string `json:"id,omitempty"` - Request *Request `json:"request,omitempty"` - Source *Source `json:"source,omitempty"` - Target *Target `json:"target,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` -} - -func (o *EventContent) GetTimestampAsTime() (*time.Time, error) { - if o.Timestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *EventContent) SetTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Timestamp = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventinfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventinfo.go deleted file mode 100644 index 87c33e7f07da..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventinfo.go +++ /dev/null @@ -1,8 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EventInfo struct { - Id *string `json:"id,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventrequestmessage.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventrequestmessage.go deleted file mode 100644 index 56f335b1ea96..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventrequestmessage.go +++ /dev/null @@ -1,12 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EventRequestMessage struct { - Content *EventContent `json:"content,omitempty"` - Headers *map[string]string `json:"headers,omitempty"` - Method *string `json:"method,omitempty"` - RequestUri *string `json:"requestUri,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventresponsemessage.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventresponsemessage.go deleted file mode 100644 index ece546cd8089..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_eventresponsemessage.go +++ /dev/null @@ -1,12 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EventResponseMessage struct { - Content *string `json:"content,omitempty"` - Headers *map[string]string `json:"headers,omitempty"` - ReasonPhrase *string `json:"reasonPhrase,omitempty"` - StatusCode *string `json:"statusCode,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_request.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_request.go deleted file mode 100644 index 87e35e6473d7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_request.go +++ /dev/null @@ -1,12 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Request struct { - Addr *string `json:"addr,omitempty"` - Host *string `json:"host,omitempty"` - Id *string `json:"id,omitempty"` - Method *string `json:"method,omitempty"` - Useragent *string `json:"useragent,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_source.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_source.go deleted file mode 100644 index 6c986c31c040..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_source.go +++ /dev/null @@ -1,9 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Source struct { - Addr *string `json:"addr,omitempty"` - InstanceID *string `json:"instanceID,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_target.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_target.go deleted file mode 100644 index 4cbc07d50ded..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_target.go +++ /dev/null @@ -1,16 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Target struct { - Digest *string `json:"digest,omitempty"` - Length *int64 `json:"length,omitempty"` - MediaType *string `json:"mediaType,omitempty"` - Name *string `json:"name,omitempty"` - Repository *string `json:"repository,omitempty"` - Size *int64 `json:"size,omitempty"` - Tag *string `json:"tag,omitempty"` - Url *string `json:"url,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhook.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhook.go deleted file mode 100644 index 66a677d90be4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhook.go +++ /dev/null @@ -1,18 +0,0 @@ -package webhooks - -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 Webhook struct { - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *WebhookProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookcreateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookcreateparameters.go deleted file mode 100644 index 7a7d23fef424..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookcreateparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebhookCreateParameters struct { - Location string `json:"location"` - Properties *WebhookPropertiesCreateParameters `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookproperties.go deleted file mode 100644 index 987c402d3c1c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebhookProperties struct { - Actions []WebhookAction `json:"actions"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Scope *string `json:"scope,omitempty"` - Status *WebhookStatus `json:"status,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiescreateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiescreateparameters.go deleted file mode 100644 index 5c31614b8c78..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiescreateparameters.go +++ /dev/null @@ -1,12 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebhookPropertiesCreateParameters struct { - Actions []WebhookAction `json:"actions"` - CustomHeaders *map[string]string `json:"customHeaders,omitempty"` - Scope *string `json:"scope,omitempty"` - ServiceUri string `json:"serviceUri"` - Status *WebhookStatus `json:"status,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiesupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiesupdateparameters.go deleted file mode 100644 index 17d1bcfa8ce6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookpropertiesupdateparameters.go +++ /dev/null @@ -1,12 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebhookPropertiesUpdateParameters struct { - Actions *[]WebhookAction `json:"actions,omitempty"` - CustomHeaders *map[string]string `json:"customHeaders,omitempty"` - Scope *string `json:"scope,omitempty"` - ServiceUri *string `json:"serviceUri,omitempty"` - Status *WebhookStatus `json:"status,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookupdateparameters.go deleted file mode 100644 index 2cf0241fdf6d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/model_webhookupdateparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebhookUpdateParameters struct { - Properties *WebhookPropertiesUpdateParameters `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/predicates.go deleted file mode 100644 index 946905715c8d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/predicates.go +++ /dev/null @@ -1,45 +0,0 @@ -package webhooks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EventOperationPredicate struct { - Id *string -} - -func (p EventOperationPredicate) Matches(input Event) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - return true -} - -type WebhookOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p WebhookOperationPredicate) Matches(input Webhook) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/version.go deleted file mode 100644 index 2b33962a2b04..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package webhooks - -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 = "2023-07-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/webhooks/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md b/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md index 0d523b52282a..1597a28b901c 100644 --- a/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md +++ b/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md @@ -1,5 +1,31 @@ # HCL Changelog +## v2.20.0 (February 29, 2024) + +### Enhancements + +* Support for namespaced functions ([#639](https://github.com/hashicorp/hcl/pull/639)) + +### Bugs Fixed + +* ext/dynblock: if `iterator` is invalid return this error instead of consequential errors ([#656](https://github.com/hashicorp/hcl/pull/656)) + +## v2.19.0 (October 16, 2023) + +### Enhancements + +* ext/dynblock: `dynblock.Expand` now supports an optional hook for calling applications to check and potentially veto (by returning error diagnostics) particular `for_each` values. The behavior is unchanged for callers that don't set the new option. ([#634](https://github.com/hashicorp/hcl/pull/634)) + +### Bugs Fixed + +* hclsyntax: Further fixes for treatment of "marked" values in the conditional expression, and better tracking of refined values into the conditional expression results, building on the fixes from v2.18.1. ([#633](https://github.com/hashicorp/hcl/pull/633)) + +## v2.18.1 (October 5, 2023) + +### Bugs Fixed + +* hclsyntax: Conditional expressions will no longer panic when one or both of their results are "marked", as is the case for situations like how HashiCorp Terraform tracks its concept of "sensitive values". ([#630](https://github.com/hashicorp/hcl/pull/630)) + ## v2.18.0 (August 30, 2023) ### Enhancements @@ -27,7 +53,7 @@ * HCL now uses a newer version of the upstream `cty` library which has improved treatment of unknown values: it can now track additional optional information that reduces the range of an unknown value, which allows some operations against unknown values to return known or partially-known results. ([#590](https://github.com/hashicorp/hcl/pull/590)) **Note:** This change effectively passes on [`cty`'s notion of backward compatibility](https://github.com/zclconf/go-cty/blob/main/COMPATIBILITY.md) whereby unknown values can become "more known" in later releases. In particular, if your caller is using `cty.Value.RawEquals` in its tests against the results of operations with unknown values then you may see those tests begin failing after upgrading, due to the values now being more "refined". - + If so, you should review the refinements with consideration to [the `cty` refinements docs](https://github.com/zclconf/go-cty/blob/7dcbae46a6f247e983efb1fa774d2bb68781a333/docs/refinements.md) and update your expected results to match only if the reported refinements seem correct for the given situation. The `RawEquals` method is intended only for making exact value comparisons in test cases, so main application code should not use it; use `Equals` instead for real logic, which will take refinements into account automatically. ## v2.16.2 (March 9, 2023) @@ -157,7 +183,7 @@ * hclsyntax: Mark objects with keys that are sensitive. ([#440](https://github.com/hashicorp/hcl/pull/440)) ## v2.8.1 (December 17, 2020) - + ### Bugs Fixed * hclsyntax: Fix panic when expanding marked function arguments. ([#429](https://github.com/hashicorp/hcl/pull/429)) diff --git a/vendor/github.com/hashicorp/hcl/v2/Makefile b/vendor/github.com/hashicorp/hcl/v2/Makefile new file mode 100644 index 000000000000..675178e74758 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/Makefile @@ -0,0 +1,18 @@ +fmtcheck: + "$(CURDIR)/scripts/gofmtcheck.sh" + +fmtfix: + gofmt -w ./ + +vetcheck: + go vet ./... + +copyrightcheck: + go run github.com/hashicorp/copywrite@latest headers --plan + +copyrightfix: + go run github.com/hashicorp/copywrite@latest headers + +check: copyrightcheck vetcheck fmtcheck + +fix: copyrightfix fmtfix diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go index 5df423fec240..c4a353c4bd14 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go @@ -6,6 +6,7 @@ package hclsyntax import ( "fmt" "sort" + "strings" "sync" "github.com/hashicorp/hcl/v2" @@ -251,6 +252,76 @@ func (e *FunctionCallExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnosti } } + extraUnknown := &functionCallUnknown{ + name: e.Name, + } + + // For historical reasons, we represent namespaced function names + // as strings with :: separating the names. If this was an attempt + // to call a namespaced function then we'll try to distinguish + // between an invalid namespace or an invalid name within a valid + // namespace in order to give the user better feedback about what + // is wrong. + // + // The parser guarantees that a function name will always + // be a series of valid identifiers separated by "::" with no + // other content, so we can be relatively unforgiving in our processing + // here. + if sepIdx := strings.LastIndex(e.Name, "::"); sepIdx != -1 { + namespace := e.Name[:sepIdx+2] + name := e.Name[sepIdx+2:] + + avail := make([]string, 0, len(ctx.Functions)) + for availName := range ctx.Functions { + if strings.HasPrefix(availName, namespace) { + avail = append(avail, availName) + } + } + + extraUnknown.name = name + extraUnknown.namespace = namespace + + if len(avail) == 0 { + // TODO: Maybe use nameSuggestion for the other available + // namespaces? But that'd require us to go scan the function + // table again, so we'll wait to see if it's really warranted. + // For now, we're assuming people are more likely to misremember + // the function names than the namespaces, because in many + // applications there will be relatively few namespaces compared + // to the number of distinct functions. + return cty.DynamicVal, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Call to unknown function", + Detail: fmt.Sprintf("There are no functions in namespace %q.", namespace), + Subject: &e.NameRange, + Context: e.Range().Ptr(), + Expression: e, + EvalContext: ctx, + Extra: extraUnknown, + }, + } + } else { + suggestion := nameSuggestion(name, avail) + if suggestion != "" { + suggestion = fmt.Sprintf(" Did you mean %s%s?", namespace, suggestion) + } + + return cty.DynamicVal, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Call to unknown function", + Detail: fmt.Sprintf("There is no function named %q in namespace %s.%s", name, namespace, suggestion), + Subject: &e.NameRange, + Context: e.Range().Ptr(), + Expression: e, + EvalContext: ctx, + Extra: extraUnknown, + }, + } + } + } + avail := make([]string, 0, len(ctx.Functions)) for name := range ctx.Functions { avail = append(avail, name) @@ -269,6 +340,7 @@ func (e *FunctionCallExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnosti Context: e.Range().Ptr(), Expression: e, EvalContext: ctx, + Extra: extraUnknown, }, } } @@ -616,6 +688,27 @@ func (e *functionCallDiagExtra) FunctionCallError() error { return e.functionCallError } +// FunctionCallUnknownDiagExtra is an interface implemented by a value in the Extra +// field of some diagnostics to indicate when the error was caused by a call to +// an unknown function. +type FunctionCallUnknownDiagExtra interface { + CalledFunctionName() string + CalledFunctionNamespace() string +} + +type functionCallUnknown struct { + name string + namespace string +} + +func (e *functionCallUnknown) CalledFunctionName() string { + return e.name +} + +func (e *functionCallUnknown) CalledFunctionNamespace() string { + return e.namespace +} + type ConditionalExpr struct { Condition Expression TrueResult Expression @@ -696,60 +789,95 @@ func (e *ConditionalExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostic return cty.UnknownVal(resultType), diags } if !condResult.IsKnown() { + // we use the unmarked values throughout the unknown branch + _, condResultMarks := condResult.Unmark() + trueResult, trueResultMarks := trueResult.Unmark() + falseResult, falseResultMarks := falseResult.Unmark() + + // use a value to merge marks + _, resMarks := cty.DynamicVal.WithMarks(condResultMarks, trueResultMarks, falseResultMarks).Unmark() + + trueRange := trueResult.Range() + falseRange := falseResult.Range() + + // if both branches are known to be null, then the result must still be null + if trueResult.IsNull() && falseResult.IsNull() { + return cty.NullVal(resultType).WithMarks(resMarks), diags + } + // We might be able to offer a refined range for the result based on // the two possible outcomes. if trueResult.Type() == cty.Number && falseResult.Type() == cty.Number { - // This case deals with the common case of (predicate ? 1 : 0) and - // significantly decreases the range of the result in that case. - if !(trueResult.IsNull() || falseResult.IsNull()) { - if gt := trueResult.GreaterThan(falseResult); gt.IsKnown() { - b := cty.UnknownVal(cty.Number).Refine() - if gt.True() { - b = b. - NumberRangeLowerBound(falseResult, true). - NumberRangeUpperBound(trueResult, true) - } else { - b = b. - NumberRangeLowerBound(trueResult, true). - NumberRangeUpperBound(falseResult, true) - } - b = b.NotNull() // If neither of the results is null then the result can't be either - return b.NewValue().WithSameMarks(condResult).WithSameMarks(trueResult).WithSameMarks(falseResult), diags + ref := cty.UnknownVal(cty.Number).Refine() + if trueRange.DefinitelyNotNull() && falseRange.DefinitelyNotNull() { + ref = ref.NotNull() + } + + falseLo, falseLoInc := falseRange.NumberLowerBound() + falseHi, falseHiInc := falseRange.NumberUpperBound() + trueLo, trueLoInc := trueRange.NumberLowerBound() + trueHi, trueHiInc := trueRange.NumberUpperBound() + + if falseLo.IsKnown() && trueLo.IsKnown() { + lo, loInc := falseLo, falseLoInc + switch { + case trueLo.LessThan(falseLo).True(): + lo, loInc = trueLo, trueLoInc + case trueLo.Equals(falseLo).True(): + loInc = trueLoInc || falseLoInc + } + + ref = ref.NumberRangeLowerBound(lo, loInc) + } + + if falseHi.IsKnown() && trueHi.IsKnown() { + hi, hiInc := falseHi, falseHiInc + switch { + case trueHi.GreaterThan(falseHi).True(): + hi, hiInc = trueHi, trueHiInc + case trueHi.Equals(falseHi).True(): + hiInc = trueHiInc || falseHiInc } + ref = ref.NumberRangeUpperBound(hi, hiInc) } + + return ref.NewValue().WithMarks(resMarks), diags } + if trueResult.Type().IsCollectionType() && falseResult.Type().IsCollectionType() { if trueResult.Type().Equals(falseResult.Type()) { - if !(trueResult.IsNull() || falseResult.IsNull()) { - trueLen := trueResult.Length() - falseLen := falseResult.Length() - if gt := trueLen.GreaterThan(falseLen); gt.IsKnown() { - b := cty.UnknownVal(resultType).Refine() - trueLen, _ := trueLen.AsBigFloat().Int64() - falseLen, _ := falseLen.AsBigFloat().Int64() - if gt.True() { - b = b. - CollectionLengthLowerBound(int(falseLen)). - CollectionLengthUpperBound(int(trueLen)) - } else { - b = b. - CollectionLengthLowerBound(int(trueLen)). - CollectionLengthUpperBound(int(falseLen)) - } - b = b.NotNull() // If neither of the results is null then the result can't be either - return b.NewValue().WithSameMarks(condResult).WithSameMarks(trueResult).WithSameMarks(falseResult), diags - } + ref := cty.UnknownVal(resultType).Refine() + if trueRange.DefinitelyNotNull() && falseRange.DefinitelyNotNull() { + ref = ref.NotNull() + } + + falseLo := falseRange.LengthLowerBound() + falseHi := falseRange.LengthUpperBound() + trueLo := trueRange.LengthLowerBound() + trueHi := trueRange.LengthUpperBound() + + lo := falseLo + if trueLo < falseLo { + lo = trueLo + } + + hi := falseHi + if trueHi > falseHi { + hi = trueHi } + + ref = ref.CollectionLengthLowerBound(lo).CollectionLengthUpperBound(hi) + return ref.NewValue().WithMarks(resMarks), diags } } - trueRng := trueResult.Range() - falseRng := falseResult.Range() + ret := cty.UnknownVal(resultType) - if trueRng.DefinitelyNotNull() && falseRng.DefinitelyNotNull() { + if trueRange.DefinitelyNotNull() && falseRange.DefinitelyNotNull() { ret = ret.RefineNotNull() } - return ret.WithSameMarks(condResult).WithSameMarks(trueResult).WithSameMarks(falseResult), diags + return ret.WithMarks(resMarks), diags } + condResult, err := convert.Convert(condResult, cty.Bool) if err != nil { diags = append(diags, &hcl.Diagnostic{ @@ -1240,9 +1368,9 @@ func (e *ObjectConsKeyExpr) UnwrapExpression() Expression { // ForExpr represents iteration constructs: // -// tuple = [for i, v in list: upper(v) if i > 2] -// object = {for k, v in map: k => upper(v)} -// object_of_tuples = {for v in list: v.key: v...} +// tuple = [for i, v in list: upper(v) if i > 2] +// object = {for k, v in map: k => upper(v)} +// object_of_tuples = {for v in list: v.key: v...} type ForExpr struct { KeyVar string // empty if ignoring the key ValVar string @@ -1738,7 +1866,8 @@ func (e *SplatExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { if ty.IsListType() && sourceVal.Type().IsCollectionType() { // We can refine the length of an unknown list result based on // the source collection's own length. - sourceRng := sourceVal.Range() + sv, _ := sourceVal.Unmark() + sourceRng := sv.Range() ret = ret.Refine(). CollectionLengthLowerBound(sourceRng.LengthLowerBound()). CollectionLengthUpperBound(sourceRng.LengthUpperBound()). diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/generate.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/generate.go index 383ec6b85d60..66486074c7cf 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/generate.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/generate.go @@ -9,4 +9,4 @@ package hclsyntax //go:generate gofmt -w scan_tokens.go //go:generate ragel -Z scan_string_lit.rl //go:generate gofmt -w scan_string_lit.go -//go:generate stringer -type TokenType -output token_type_string.go +//go:generate go run golang.org/x/tools/cmd/stringer -type TokenType -output token_type_string.go diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go index aa147afeb49a..cd9d63d2d14c 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go @@ -999,7 +999,7 @@ func (p *parser) parseExpressionTerm() (Expression, hcl.Diagnostics) { case TokenIdent: tok := p.Read() // eat identifier token - if p.Peek().Type == TokenOParen { + if p.Peek().Type == TokenOParen || p.Peek().Type == TokenDoubleColon { return p.finishParsingFunctionCall(tok) } @@ -1145,16 +1145,65 @@ func (p *parser) numberLitValue(tok Token) (cty.Value, hcl.Diagnostics) { // finishParsingFunctionCall parses a function call assuming that the function // name was already read, and so the peeker should be pointing at the opening -// parenthesis after the name. +// parenthesis after the name, or at the double-colon after the initial +// function scope name. func (p *parser) finishParsingFunctionCall(name Token) (Expression, hcl.Diagnostics) { + var diags hcl.Diagnostics + openTok := p.Read() - if openTok.Type != TokenOParen { + if openTok.Type != TokenOParen && openTok.Type != TokenDoubleColon { // should never happen if callers behave - panic("finishParsingFunctionCall called with non-parenthesis as next token") + panic("finishParsingFunctionCall called with unsupported next token") + } + + nameStr := string(name.Bytes) + nameEndPos := name.Range.End + for openTok.Type == TokenDoubleColon { + nextName := p.Read() + if nextName.Type != TokenIdent { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing function name", + Detail: "Function scope resolution symbol :: must be followed by a function name in this scope.", + Subject: &nextName.Range, + Context: hcl.RangeBetween(name.Range, nextName.Range).Ptr(), + }) + p.recoverOver(TokenOParen) + return nil, diags + } + + // Initial versions of HCLv2 didn't support function namespaces, and + // so for backward compatibility we just treat namespaced functions + // as weird names with "::" separators in them, saved as a string + // to keep the API unchanged. FunctionCallExpr also has some special + // handling of names containing :: when referring to a function that + // doesn't exist in EvalContext, to return better error messages + // when namespaces are used incorrectly. + nameStr = nameStr + "::" + string(nextName.Bytes) + nameEndPos = nextName.Range.End + + openTok = p.Read() + } + + nameRange := hcl.Range{ + Filename: name.Range.Filename, + Start: name.Range.Start, + End: nameEndPos, + } + + if openTok.Type != TokenOParen { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing open parenthesis", + Detail: "Function selector must be followed by an open parenthesis to begin the function call.", + Subject: &openTok.Range, + Context: hcl.RangeBetween(name.Range, openTok.Range).Ptr(), + }) + p.recoverOver(TokenOParen) + return nil, diags } var args []Expression - var diags hcl.Diagnostics var expandFinal bool var closeTok Token @@ -1218,7 +1267,7 @@ Token: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unterminated function call", - Detail: "There is no closing parenthesis for this function call before the end of the file. This may be caused by incorrect parethesis nesting elsewhere in this file.", + Detail: "There is no closing parenthesis for this function call before the end of the file. This may be caused by incorrect parenthesis nesting elsewhere in this file.", Subject: hcl.RangeBetween(name.Range, openTok.Range).Ptr(), }) default: @@ -1245,12 +1294,12 @@ Token: p.PopIncludeNewlines() return &FunctionCallExpr{ - Name: string(name.Bytes), + Name: nameStr, Args: args, ExpandFinal: expandFinal, - NameRange: name.Range, + NameRange: nameRange, OpenParenRange: openTok.Range, CloseParenRange: closeTok.Range, }, diags diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.go index 5d60ff5a5ea5..6b44d9923ba9 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.go @@ -1,13 +1,12 @@ +//line scan_string_lit.rl:1 // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -//line scan_string_lit.rl:1 - package hclsyntax // This file is generated from scan_string_lit.rl. DO NOT EDIT. -//line scan_string_lit.go:9 +//line scan_string_lit.go:11 var _hclstrtok_actions []byte = []byte{ 0, 1, 0, 1, 1, 2, 1, 0, } @@ -117,12 +116,12 @@ const hclstrtok_error int = 0 const hclstrtok_en_quoted int = 10 const hclstrtok_en_unquoted int = 4 -//line scan_string_lit.rl:10 +//line scan_string_lit.rl:12 func scanStringLit(data []byte, quoted bool) [][]byte { var ret [][]byte -//line scan_string_lit.rl:61 +//line scan_string_lit.rl:63 // Ragel state p := 0 // "Pointer" into data @@ -147,11 +146,11 @@ func scanStringLit(data []byte, quoted bool) [][]byte { ret = append(ret, data[ts:te]) }*/ -//line scan_string_lit.go:154 +//line scan_string_lit.go:156 { } -//line scan_string_lit.go:158 +//line scan_string_lit.go:160 { var _klen int var _trans int @@ -232,7 +231,7 @@ func scanStringLit(data []byte, quoted bool) [][]byte { _acts++ switch _hclstrtok_actions[_acts-1] { case 0: -//line scan_string_lit.rl:40 +//line scan_string_lit.rl:42 // If te is behind p then we've skipped over some literal // characters which we must now return. @@ -242,12 +241,12 @@ func scanStringLit(data []byte, quoted bool) [][]byte { ts = p case 1: -//line scan_string_lit.rl:48 +//line scan_string_lit.rl:50 te = p ret = append(ret, data[ts:te]) -//line scan_string_lit.go:253 +//line scan_string_lit.go:255 } } @@ -270,12 +269,12 @@ func scanStringLit(data []byte, quoted bool) [][]byte { __acts++ switch _hclstrtok_actions[__acts-1] { case 1: -//line scan_string_lit.rl:48 +//line scan_string_lit.rl:50 te = p ret = append(ret, data[ts:te]) -//line scan_string_lit.go:278 +//line scan_string_lit.go:280 } } } @@ -285,7 +284,7 @@ func scanStringLit(data []byte, quoted bool) [][]byte { } } -//line scan_string_lit.rl:89 +//line scan_string_lit.rl:91 if te < p { // Collect any leftover literal characters at the end of the input diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.rl b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.rl index f8ac1175167f..21d2c8bca381 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.rl +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.rl @@ -1,3 +1,5 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 package hclsyntax diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.go index 1bbbb92781d7..3ed8455ff872 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.go @@ -1,8 +1,7 @@ +//line scan_tokens.rl:1 // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -//line scan_tokens.rl:1 - package hclsyntax import ( @@ -13,7 +12,7 @@ import ( // This file is generated from scan_tokens.rl. DO NOT EDIT. -//line scan_tokens.go:15 +//line scan_tokens.go:17 var _hcltok_actions []byte = []byte{ 0, 1, 0, 1, 1, 1, 3, 1, 4, 1, 7, 1, 8, 1, 9, 1, 10, @@ -33,13 +32,13 @@ var _hcltok_actions []byte = []byte{ 1, 71, 1, 72, 1, 73, 1, 74, 1, 75, 1, 76, 1, 77, 1, 78, 1, 79, 1, 80, 1, 81, 1, 82, - 1, 83, 1, 84, 1, 85, 2, 0, - 14, 2, 0, 25, 2, 0, 29, 2, - 0, 37, 2, 0, 41, 2, 1, 2, - 2, 4, 5, 2, 4, 6, 2, 4, - 21, 2, 4, 22, 2, 4, 33, 2, - 4, 34, 2, 4, 45, 2, 4, 46, - 2, 4, 54, 2, 4, 55, + 1, 83, 1, 84, 1, 85, 1, 86, + 2, 0, 14, 2, 0, 25, 2, 0, + 29, 2, 0, 37, 2, 0, 41, 2, + 1, 2, 2, 4, 5, 2, 4, 6, + 2, 4, 21, 2, 4, 22, 2, 4, + 33, 2, 4, 34, 2, 4, 45, 2, + 4, 46, 2, 4, 54, 2, 4, 55, } var _hcltok_key_offsets []int16 = []int16{ @@ -225,22 +224,22 @@ var _hcltok_key_offsets []int16 = []int16{ 9153, 9171, 9172, 9182, 9183, 9192, 9200, 9202, 9205, 9207, 9209, 9211, 9216, 9229, 9233, 9248, 9277, 9288, 9290, 9294, 9298, 9303, 9307, 9309, - 9316, 9320, 9328, 9332, 9407, 9409, 9410, 9411, - 9412, 9413, 9414, 9416, 9421, 9423, 9425, 9426, - 9470, 9471, 9472, 9474, 9479, 9483, 9483, 9485, - 9487, 9498, 9508, 9516, 9517, 9519, 9520, 9524, - 9528, 9538, 9542, 9549, 9560, 9567, 9571, 9577, - 9588, 9620, 9669, 9684, 9699, 9704, 9706, 9711, - 9743, 9751, 9753, 9775, 9797, 9799, 9815, 9831, - 9833, 9835, 9835, 9836, 9837, 9838, 9840, 9841, - 9853, 9855, 9857, 9859, 9873, 9887, 9889, 9892, - 9895, 9897, 9898, 9899, 9901, 9903, 9905, 9919, - 9933, 9935, 9938, 9941, 9943, 9944, 9945, 9947, - 9949, 9951, 10000, 10044, 10046, 10051, 10055, 10055, - 10057, 10059, 10070, 10080, 10088, 10089, 10091, 10092, - 10096, 10100, 10110, 10114, 10121, 10132, 10139, 10143, - 10149, 10160, 10192, 10241, 10256, 10271, 10276, 10278, - 10283, 10315, 10323, 10325, 10347, 10369, + 9316, 9320, 9328, 9332, 9408, 9410, 9411, 9412, + 9413, 9414, 9415, 9417, 9422, 9423, 9425, 9427, + 9428, 9472, 9473, 9474, 9476, 9481, 9485, 9485, + 9487, 9489, 9500, 9510, 9518, 9519, 9521, 9522, + 9526, 9530, 9540, 9544, 9551, 9562, 9569, 9573, + 9579, 9590, 9622, 9671, 9686, 9701, 9706, 9708, + 9713, 9745, 9753, 9755, 9777, 9799, 9801, 9817, + 9833, 9835, 9837, 9837, 9838, 9839, 9840, 9842, + 9843, 9855, 9857, 9859, 9861, 9875, 9889, 9891, + 9894, 9897, 9899, 9900, 9901, 9903, 9905, 9907, + 9921, 9935, 9937, 9940, 9943, 9945, 9946, 9947, + 9949, 9951, 9953, 10002, 10046, 10048, 10053, 10057, + 10057, 10059, 10061, 10072, 10082, 10090, 10091, 10093, + 10094, 10098, 10102, 10112, 10116, 10123, 10134, 10141, + 10145, 10151, 10162, 10194, 10243, 10258, 10273, 10278, + 10280, 10285, 10317, 10325, 10327, 10349, 10371, } var _hcltok_trans_keys []byte = []byte{ @@ -263,7 +262,7 @@ var _hcltok_trans_keys []byte = []byte{ 233, 234, 237, 239, 240, 243, 48, 57, 65, 90, 97, 122, 196, 218, 229, 236, 10, 170, 181, 183, 186, 128, 150, 152, - 182, 184, 255, 192, 255, 128, 255, 173, + 182, 184, 255, 192, 255, 0, 127, 173, 130, 133, 146, 159, 165, 171, 175, 255, 181, 190, 184, 185, 192, 255, 140, 134, 138, 142, 161, 163, 255, 182, 130, 136, @@ -572,7 +571,7 @@ var _hcltok_trans_keys []byte = []byte{ 150, 153, 131, 140, 255, 160, 163, 164, 165, 184, 185, 186, 161, 162, 133, 255, 170, 181, 183, 186, 128, 150, 152, 182, - 184, 255, 192, 255, 128, 255, 173, 130, + 184, 255, 192, 255, 0, 127, 173, 130, 133, 146, 159, 165, 171, 175, 255, 181, 190, 184, 185, 192, 255, 140, 134, 138, 142, 161, 163, 255, 182, 130, 136, 137, @@ -1411,136 +1410,136 @@ var _hcltok_trans_keys []byte = []byte{ 187, 191, 192, 255, 162, 191, 192, 255, 160, 168, 128, 159, 161, 167, 169, 191, 158, 191, 192, 255, 9, 10, 13, 32, - 33, 34, 35, 38, 46, 47, 60, 61, - 62, 64, 92, 95, 123, 124, 125, 126, - 127, 194, 195, 198, 199, 203, 204, 205, - 206, 207, 210, 212, 213, 214, 215, 216, - 217, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 233, 234, 237, 238, 239, - 240, 0, 36, 37, 45, 48, 57, 58, - 63, 65, 90, 91, 96, 97, 122, 192, - 193, 196, 218, 229, 236, 241, 247, 9, - 32, 10, 61, 10, 38, 46, 42, 47, - 46, 69, 101, 48, 57, 60, 61, 61, - 62, 61, 45, 95, 194, 195, 198, 199, - 203, 204, 205, 206, 207, 210, 212, 213, - 214, 215, 216, 217, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 233, 234, - 237, 239, 240, 243, 48, 57, 65, 90, - 97, 122, 196, 218, 229, 236, 124, 125, - 128, 191, 170, 181, 186, 128, 191, 151, - 183, 128, 255, 192, 255, 0, 127, 173, - 130, 133, 146, 159, 165, 171, 175, 191, - 192, 255, 181, 190, 128, 175, 176, 183, - 184, 185, 186, 191, 134, 139, 141, 162, - 128, 135, 136, 255, 182, 130, 137, 176, - 151, 152, 154, 160, 136, 191, 192, 255, - 128, 143, 144, 170, 171, 175, 176, 178, - 179, 191, 128, 159, 160, 191, 176, 128, - 138, 139, 173, 174, 255, 148, 150, 164, - 167, 173, 176, 185, 189, 190, 192, 255, - 144, 128, 145, 146, 175, 176, 191, 128, - 140, 141, 255, 166, 176, 178, 191, 192, - 255, 186, 128, 137, 138, 170, 171, 179, - 180, 181, 182, 191, 160, 161, 162, 164, - 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 128, 191, 128, 129, 130, 131, - 137, 138, 139, 140, 141, 142, 143, 144, - 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 182, 183, 184, 188, - 189, 190, 191, 132, 187, 129, 130, 132, - 133, 134, 176, 177, 178, 179, 180, 181, - 182, 183, 128, 191, 128, 129, 130, 131, - 132, 133, 134, 135, 144, 136, 143, 145, - 191, 192, 255, 182, 183, 184, 128, 191, - 128, 191, 191, 128, 190, 192, 255, 128, - 146, 147, 148, 152, 153, 154, 155, 156, - 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 129, 191, 192, 255, 158, - 159, 128, 157, 160, 191, 192, 255, 128, - 191, 164, 169, 171, 172, 173, 174, 175, - 180, 181, 182, 183, 184, 185, 187, 188, - 189, 190, 191, 128, 163, 165, 186, 144, - 145, 146, 147, 148, 150, 151, 152, 155, - 157, 158, 160, 170, 171, 172, 175, 128, - 159, 161, 169, 173, 191, 128, 191, 10, - 13, 34, 36, 37, 92, 128, 191, 192, - 223, 224, 239, 240, 247, 248, 255, 10, - 13, 34, 92, 36, 37, 128, 191, 192, - 223, 224, 239, 240, 247, 248, 255, 10, - 13, 36, 123, 123, 126, 126, 37, 123, - 126, 10, 13, 128, 191, 192, 223, 224, - 239, 240, 247, 248, 255, 128, 191, 128, + 33, 34, 35, 38, 46, 47, 58, 60, + 61, 62, 64, 92, 95, 123, 124, 125, + 126, 127, 194, 195, 198, 199, 203, 204, + 205, 206, 207, 210, 212, 213, 214, 215, + 216, 217, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 233, 234, 237, 238, + 239, 240, 0, 36, 37, 45, 48, 57, + 59, 63, 65, 90, 91, 96, 97, 122, + 192, 193, 196, 218, 229, 236, 241, 247, + 9, 32, 10, 61, 10, 38, 46, 42, + 47, 46, 69, 101, 48, 57, 58, 60, + 61, 61, 62, 61, 45, 95, 194, 195, + 198, 199, 203, 204, 205, 206, 207, 210, + 212, 213, 214, 215, 216, 217, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, + 233, 234, 237, 239, 240, 243, 48, 57, + 65, 90, 97, 122, 196, 218, 229, 236, + 124, 125, 128, 191, 170, 181, 186, 128, + 191, 151, 183, 128, 255, 192, 255, 0, + 127, 173, 130, 133, 146, 159, 165, 171, + 175, 191, 192, 255, 181, 190, 128, 175, + 176, 183, 184, 185, 186, 191, 134, 139, + 141, 162, 128, 135, 136, 255, 182, 130, + 137, 176, 151, 152, 154, 160, 136, 191, + 192, 255, 128, 143, 144, 170, 171, 175, + 176, 178, 179, 191, 128, 159, 160, 191, + 176, 128, 138, 139, 173, 174, 255, 148, + 150, 164, 167, 173, 176, 185, 189, 190, + 192, 255, 144, 128, 145, 146, 175, 176, + 191, 128, 140, 141, 255, 166, 176, 178, + 191, 192, 255, 186, 128, 137, 138, 170, + 171, 179, 180, 181, 182, 191, 160, 161, + 162, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 128, 191, 128, 129, + 130, 131, 137, 138, 139, 140, 141, 142, + 143, 144, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 182, 183, + 184, 188, 189, 190, 191, 132, 187, 129, + 130, 132, 133, 134, 176, 177, 178, 179, + 180, 181, 182, 183, 128, 191, 128, 129, + 130, 131, 132, 133, 134, 135, 144, 136, + 143, 145, 191, 192, 255, 182, 183, 184, + 128, 191, 128, 191, 191, 128, 190, 192, + 255, 128, 146, 147, 148, 152, 153, 154, + 155, 156, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 129, 191, 192, + 255, 158, 159, 128, 157, 160, 191, 192, + 255, 128, 191, 164, 169, 171, 172, 173, + 174, 175, 180, 181, 182, 183, 184, 185, + 187, 188, 189, 190, 191, 128, 163, 165, + 186, 144, 145, 146, 147, 148, 150, 151, + 152, 155, 157, 158, 160, 170, 171, 172, + 175, 128, 159, 161, 169, 173, 191, 128, + 191, 10, 13, 34, 36, 37, 92, 128, + 191, 192, 223, 224, 239, 240, 247, 248, + 255, 10, 13, 34, 92, 36, 37, 128, + 191, 192, 223, 224, 239, 240, 247, 248, + 255, 10, 13, 36, 123, 123, 126, 126, + 37, 123, 126, 10, 13, 128, 191, 192, + 223, 224, 239, 240, 247, 248, 255, 128, + 191, 128, 191, 128, 191, 10, 13, 36, + 37, 128, 191, 192, 223, 224, 239, 240, + 247, 248, 255, 10, 13, 36, 37, 128, + 191, 192, 223, 224, 239, 240, 247, 248, + 255, 10, 13, 10, 13, 123, 10, 13, + 126, 10, 13, 126, 126, 128, 191, 128, 191, 128, 191, 10, 13, 36, 37, 128, 191, 192, 223, 224, 239, 240, 247, 248, 255, 10, 13, 36, 37, 128, 191, 192, 223, 224, 239, 240, 247, 248, 255, 10, 13, 10, 13, 123, 10, 13, 126, 10, 13, 126, 126, 128, 191, 128, 191, 128, - 191, 10, 13, 36, 37, 128, 191, 192, - 223, 224, 239, 240, 247, 248, 255, 10, - 13, 36, 37, 128, 191, 192, 223, 224, - 239, 240, 247, 248, 255, 10, 13, 10, - 13, 123, 10, 13, 126, 10, 13, 126, - 126, 128, 191, 128, 191, 128, 191, 95, - 194, 195, 198, 199, 203, 204, 205, 206, - 207, 210, 212, 213, 214, 215, 216, 217, - 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 233, 234, 237, 238, 239, 240, - 65, 90, 97, 122, 128, 191, 192, 193, - 196, 218, 229, 236, 241, 247, 248, 255, - 45, 95, 194, 195, 198, 199, 203, 204, + 191, 95, 194, 195, 198, 199, 203, 204, 205, 206, 207, 210, 212, 213, 214, 215, 216, 217, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 233, 234, 237, 239, - 240, 243, 48, 57, 65, 90, 97, 122, - 196, 218, 229, 236, 128, 191, 170, 181, - 186, 128, 191, 151, 183, 128, 255, 192, - 255, 0, 127, 173, 130, 133, 146, 159, - 165, 171, 175, 191, 192, 255, 181, 190, - 128, 175, 176, 183, 184, 185, 186, 191, - 134, 139, 141, 162, 128, 135, 136, 255, - 182, 130, 137, 176, 151, 152, 154, 160, - 136, 191, 192, 255, 128, 143, 144, 170, - 171, 175, 176, 178, 179, 191, 128, 159, - 160, 191, 176, 128, 138, 139, 173, 174, - 255, 148, 150, 164, 167, 173, 176, 185, - 189, 190, 192, 255, 144, 128, 145, 146, - 175, 176, 191, 128, 140, 141, 255, 166, - 176, 178, 191, 192, 255, 186, 128, 137, - 138, 170, 171, 179, 180, 181, 182, 191, - 160, 161, 162, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 128, 191, - 128, 129, 130, 131, 137, 138, 139, 140, - 141, 142, 143, 144, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, - 182, 183, 184, 188, 189, 190, 191, 132, - 187, 129, 130, 132, 133, 134, 176, 177, - 178, 179, 180, 181, 182, 183, 128, 191, - 128, 129, 130, 131, 132, 133, 134, 135, - 144, 136, 143, 145, 191, 192, 255, 182, - 183, 184, 128, 191, 128, 191, 191, 128, - 190, 192, 255, 128, 146, 147, 148, 152, - 153, 154, 155, 156, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 129, - 191, 192, 255, 158, 159, 128, 157, 160, - 191, 192, 255, 128, 191, 164, 169, 171, - 172, 173, 174, 175, 180, 181, 182, 183, - 184, 185, 187, 188, 189, 190, 191, 128, - 163, 165, 186, 144, 145, 146, 147, 148, - 150, 151, 152, 155, 157, 158, 160, 170, - 171, 172, 175, 128, 159, 161, 169, 173, - 191, 128, 191, + 225, 226, 227, 228, 233, 234, 237, 238, + 239, 240, 65, 90, 97, 122, 128, 191, + 192, 193, 196, 218, 229, 236, 241, 247, + 248, 255, 45, 95, 194, 195, 198, 199, + 203, 204, 205, 206, 207, 210, 212, 213, + 214, 215, 216, 217, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 233, 234, + 237, 239, 240, 243, 48, 57, 65, 90, + 97, 122, 196, 218, 229, 236, 128, 191, + 170, 181, 186, 128, 191, 151, 183, 128, + 255, 192, 255, 0, 127, 173, 130, 133, + 146, 159, 165, 171, 175, 191, 192, 255, + 181, 190, 128, 175, 176, 183, 184, 185, + 186, 191, 134, 139, 141, 162, 128, 135, + 136, 255, 182, 130, 137, 176, 151, 152, + 154, 160, 136, 191, 192, 255, 128, 143, + 144, 170, 171, 175, 176, 178, 179, 191, + 128, 159, 160, 191, 176, 128, 138, 139, + 173, 174, 255, 148, 150, 164, 167, 173, + 176, 185, 189, 190, 192, 255, 144, 128, + 145, 146, 175, 176, 191, 128, 140, 141, + 255, 166, 176, 178, 191, 192, 255, 186, + 128, 137, 138, 170, 171, 179, 180, 181, + 182, 191, 160, 161, 162, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, + 128, 191, 128, 129, 130, 131, 137, 138, + 139, 140, 141, 142, 143, 144, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 182, 183, 184, 188, 189, 190, + 191, 132, 187, 129, 130, 132, 133, 134, + 176, 177, 178, 179, 180, 181, 182, 183, + 128, 191, 128, 129, 130, 131, 132, 133, + 134, 135, 144, 136, 143, 145, 191, 192, + 255, 182, 183, 184, 128, 191, 128, 191, + 191, 128, 190, 192, 255, 128, 146, 147, + 148, 152, 153, 154, 155, 156, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, + 176, 129, 191, 192, 255, 158, 159, 128, + 157, 160, 191, 192, 255, 128, 191, 164, + 169, 171, 172, 173, 174, 175, 180, 181, + 182, 183, 184, 185, 187, 188, 189, 190, + 191, 128, 163, 165, 186, 144, 145, 146, + 147, 148, 150, 151, 152, 155, 157, 158, + 160, 170, 171, 172, 175, 128, 159, 161, + 169, 173, 191, 128, 191, } var _hcltok_single_lengths []byte = []byte{ @@ -1726,22 +1725,22 @@ var _hcltok_single_lengths []byte = []byte{ 12, 1, 4, 1, 5, 2, 0, 3, 2, 2, 2, 1, 7, 0, 7, 17, 3, 0, 2, 0, 3, 0, 0, 1, - 0, 2, 0, 53, 2, 1, 1, 1, - 1, 1, 2, 3, 2, 2, 1, 34, - 1, 1, 0, 3, 2, 0, 0, 0, - 1, 2, 4, 1, 0, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 1, - 30, 47, 13, 9, 3, 0, 1, 28, - 2, 0, 18, 16, 0, 6, 4, 2, - 2, 0, 1, 1, 1, 2, 1, 2, - 0, 0, 0, 4, 2, 2, 3, 3, - 2, 1, 1, 0, 0, 0, 4, 2, - 2, 3, 3, 2, 1, 1, 0, 0, - 0, 33, 34, 0, 3, 2, 0, 0, + 0, 2, 0, 54, 2, 1, 1, 1, + 1, 1, 2, 3, 1, 2, 2, 1, + 34, 1, 1, 0, 3, 2, 0, 0, 0, 1, 2, 4, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 30, 47, 13, 9, 3, 0, 1, - 28, 2, 0, 18, 16, 0, + 28, 2, 0, 18, 16, 0, 6, 4, + 2, 2, 0, 1, 1, 1, 2, 1, + 2, 0, 0, 0, 4, 2, 2, 3, + 3, 2, 1, 1, 0, 0, 0, 4, + 2, 2, 3, 3, 2, 1, 1, 0, + 0, 0, 33, 34, 0, 3, 2, 0, + 0, 0, 1, 2, 4, 1, 0, 1, + 0, 0, 0, 0, 1, 1, 1, 0, + 0, 1, 30, 47, 13, 9, 3, 0, + 1, 28, 2, 0, 18, 16, 0, } var _hcltok_range_lengths []byte = []byte{ @@ -1928,21 +1927,21 @@ var _hcltok_range_lengths []byte = []byte{ 0, 0, 0, 2, 3, 2, 4, 6, 4, 1, 1, 2, 1, 2, 1, 3, 2, 3, 2, 11, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 5, - 0, 0, 1, 1, 1, 0, 1, 1, - 5, 4, 2, 0, 1, 0, 2, 2, - 5, 2, 3, 5, 3, 2, 3, 5, - 1, 1, 1, 3, 1, 1, 2, 2, - 3, 1, 2, 3, 1, 5, 6, 0, - 0, 0, 0, 0, 0, 0, 0, 5, - 1, 1, 1, 5, 6, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 5, 6, - 0, 0, 0, 0, 0, 0, 1, 1, - 1, 8, 5, 1, 1, 1, 0, 1, + 0, 0, 0, 1, 0, 0, 0, 0, + 5, 0, 0, 1, 1, 1, 0, 1, 1, 5, 4, 2, 0, 1, 0, 2, 2, 5, 2, 3, 5, 3, 2, 3, 5, 1, 1, 1, 3, 1, 1, 2, - 2, 3, 1, 2, 3, 1, + 2, 3, 1, 2, 3, 1, 5, 6, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 1, 1, 1, 5, 6, 0, 0, + 0, 0, 0, 0, 1, 1, 1, 5, + 6, 0, 0, 0, 0, 0, 0, 1, + 1, 1, 8, 5, 1, 1, 1, 0, + 1, 1, 5, 4, 2, 0, 1, 0, + 2, 2, 5, 2, 3, 5, 3, 2, + 3, 5, 1, 1, 1, 3, 1, 1, + 2, 2, 3, 1, 2, 3, 1, } var _hcltok_index_offsets []int16 = []int16{ @@ -2128,22 +2127,22 @@ var _hcltok_index_offsets []int16 = []int16{ 7187, 7203, 7205, 7213, 7215, 7223, 7229, 7231, 7235, 7238, 7241, 7244, 7248, 7259, 7262, 7274, 7298, 7306, 7308, 7312, 7315, 7320, 7323, 7325, - 7330, 7333, 7339, 7342, 7407, 7410, 7412, 7414, - 7416, 7418, 7420, 7423, 7428, 7431, 7434, 7436, - 7476, 7478, 7480, 7482, 7487, 7491, 7492, 7494, - 7496, 7503, 7510, 7517, 7519, 7521, 7523, 7526, - 7529, 7535, 7538, 7543, 7550, 7555, 7558, 7562, - 7569, 7601, 7650, 7665, 7678, 7683, 7685, 7689, - 7720, 7726, 7728, 7749, 7769, 7771, 7783, 7794, - 7797, 7800, 7801, 7803, 7805, 7807, 7810, 7812, - 7820, 7822, 7824, 7826, 7836, 7845, 7848, 7852, - 7856, 7859, 7861, 7863, 7865, 7867, 7869, 7879, - 7888, 7891, 7895, 7899, 7902, 7904, 7906, 7908, - 7910, 7912, 7954, 7994, 7996, 8001, 8005, 8006, - 8008, 8010, 8017, 8024, 8031, 8033, 8035, 8037, - 8040, 8043, 8049, 8052, 8057, 8064, 8069, 8072, - 8076, 8083, 8115, 8164, 8179, 8192, 8197, 8199, - 8203, 8234, 8240, 8242, 8263, 8283, + 7330, 7333, 7339, 7342, 7408, 7411, 7413, 7415, + 7417, 7419, 7421, 7424, 7429, 7431, 7434, 7437, + 7439, 7479, 7481, 7483, 7485, 7490, 7494, 7495, + 7497, 7499, 7506, 7513, 7520, 7522, 7524, 7526, + 7529, 7532, 7538, 7541, 7546, 7553, 7558, 7561, + 7565, 7572, 7604, 7653, 7668, 7681, 7686, 7688, + 7692, 7723, 7729, 7731, 7752, 7772, 7774, 7786, + 7797, 7800, 7803, 7804, 7806, 7808, 7810, 7813, + 7815, 7823, 7825, 7827, 7829, 7839, 7848, 7851, + 7855, 7859, 7862, 7864, 7866, 7868, 7870, 7872, + 7882, 7891, 7894, 7898, 7902, 7905, 7907, 7909, + 7911, 7913, 7915, 7957, 7997, 7999, 8004, 8008, + 8009, 8011, 8013, 8020, 8027, 8034, 8036, 8038, + 8040, 8043, 8046, 8052, 8055, 8060, 8067, 8072, + 8075, 8079, 8086, 8118, 8167, 8182, 8195, 8200, + 8202, 8206, 8237, 8243, 8245, 8266, 8286, } var _hcltok_indicies []int16 = []int16{ @@ -2165,7 +2164,7 @@ var _hcltok_indicies []int16 = []int16{ 61, 62, 37, 39, 63, 41, 64, 65, 66, 11, 11, 11, 14, 38, 0, 44, 0, 11, 11, 11, 11, 0, 11, 11, - 11, 0, 11, 0, 11, 11, 0, 0, + 11, 0, 11, 0, 11, 0, 11, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 11, 11, 11, 11, 11, 0, 0, 11, 0, 0, 11, 0, 11, 0, 0, @@ -2418,7 +2417,7 @@ var _hcltok_indicies []int16 = []int16{ 11, 16, 417, 16, 265, 300, 301, 302, 14, 0, 0, 11, 419, 419, 419, 419, 418, 419, 419, 419, 418, 419, 418, 419, - 419, 418, 418, 418, 418, 418, 418, 419, + 418, 419, 418, 418, 418, 418, 418, 419, 418, 418, 418, 418, 419, 419, 419, 419, 419, 418, 418, 419, 418, 418, 419, 418, 419, 418, 418, 419, 418, 418, 418, 419, @@ -3066,123 +3065,123 @@ var _hcltok_indicies []int16 = []int16{ 1045, 801, 1046, 1045, 795, 1050, 1141, 1047, 1059, 1047, 1045, 1046, 1045, 795, 1142, 1143, 1144, 1142, 1145, 1146, 1147, 1149, 1150, 1151, - 1152, 1153, 1154, 670, 670, 419, 1155, 1156, - 1157, 1158, 670, 1161, 1162, 1164, 1165, 1166, - 1160, 1167, 1168, 1169, 1170, 1171, 1172, 1173, + 1152, 1153, 1154, 1155, 670, 670, 419, 1156, + 1157, 1158, 1159, 670, 1162, 1163, 1165, 1166, + 1167, 1161, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, - 1182, 1183, 1184, 1185, 1186, 1188, 1189, 1190, - 1191, 1192, 1193, 670, 1148, 7, 1148, 419, - 1148, 419, 1160, 1163, 1187, 1194, 1159, 1142, - 1142, 1195, 1143, 1196, 1198, 1197, 4, 1147, - 1200, 1197, 1201, 1197, 2, 1147, 1197, 6, - 8, 8, 7, 1202, 1203, 1204, 1197, 1205, - 1206, 1197, 1207, 1197, 419, 419, 1209, 1210, - 489, 470, 1211, 470, 1212, 1213, 1214, 1215, - 1216, 1217, 1218, 1219, 1220, 1221, 1222, 544, - 1223, 520, 1224, 1225, 1226, 1227, 1228, 1229, - 1230, 1231, 1232, 1233, 1234, 1235, 419, 419, - 419, 425, 565, 1208, 1236, 1197, 1237, 1197, - 670, 1238, 419, 419, 419, 670, 1238, 670, - 670, 419, 1238, 419, 1238, 419, 1238, 419, - 670, 670, 670, 670, 670, 1238, 419, 670, - 670, 670, 419, 670, 419, 1238, 419, 670, - 670, 670, 670, 419, 1238, 670, 419, 670, - 419, 670, 419, 670, 670, 419, 670, 1238, - 419, 670, 419, 670, 419, 670, 1238, 670, - 419, 1238, 670, 419, 670, 419, 1238, 670, - 670, 670, 670, 670, 1238, 419, 419, 670, - 419, 670, 1238, 670, 419, 1238, 670, 670, - 1238, 419, 419, 670, 419, 670, 419, 670, - 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, - 1246, 1247, 1248, 1249, 715, 1250, 1251, 1252, - 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, - 1261, 1260, 1262, 1263, 1264, 1265, 1266, 671, - 1238, 1267, 1268, 1269, 1270, 1271, 1272, 1273, - 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, - 1282, 1283, 1284, 1285, 725, 1286, 1287, 1288, - 692, 1289, 1290, 1291, 1292, 1293, 1294, 671, - 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, - 674, 1303, 671, 674, 1304, 1305, 1306, 1307, - 683, 1238, 1308, 1309, 1310, 1311, 703, 1312, - 1313, 683, 1314, 1315, 1316, 1317, 1318, 671, - 1238, 1319, 1278, 1320, 1321, 1322, 683, 1323, - 1324, 674, 671, 683, 425, 1238, 1288, 671, - 674, 683, 425, 683, 425, 1325, 683, 1238, - 425, 674, 1326, 1327, 674, 1328, 1329, 681, - 1330, 1331, 1332, 1333, 1334, 1284, 1335, 1336, - 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, - 1345, 1346, 1303, 1347, 674, 683, 425, 1238, - 1348, 1349, 683, 671, 1238, 425, 671, 1238, - 674, 1350, 731, 1351, 1352, 1353, 1354, 1355, - 1356, 1357, 1358, 671, 1359, 1360, 1361, 1362, - 1363, 1364, 671, 683, 1238, 1366, 1367, 1368, - 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376, - 1372, 1378, 1379, 1380, 1381, 1365, 1377, 1365, - 1238, 1365, 1238, 1382, 1382, 1383, 1384, 1385, - 1386, 1387, 1388, 1389, 1390, 1387, 767, 1391, - 1391, 1391, 1392, 1391, 1391, 768, 769, 770, - 1391, 767, 1382, 1382, 1393, 1396, 1397, 1395, - 1398, 1399, 1398, 1400, 1391, 1402, 1401, 1396, - 1403, 1395, 1405, 1404, 1394, 1394, 1394, 768, - 769, 770, 1394, 767, 767, 1406, 773, 1406, - 1407, 1406, 775, 1408, 1409, 1410, 1411, 1412, - 1413, 1414, 1411, 776, 775, 1408, 1415, 1415, - 777, 779, 1416, 1415, 776, 1418, 1419, 1417, - 1418, 1419, 1420, 1417, 775, 1408, 1421, 1415, - 775, 1408, 1415, 1423, 1422, 1425, 1424, 776, - 1426, 777, 1426, 779, 1426, 785, 1427, 1428, - 1429, 1430, 1431, 1432, 1433, 1430, 786, 785, - 1427, 1434, 1434, 787, 789, 1435, 1434, 786, - 1437, 1438, 1436, 1437, 1438, 1439, 1436, 785, - 1427, 1440, 1434, 785, 1427, 1434, 1442, 1441, - 1444, 1443, 786, 1445, 787, 1445, 789, 1445, - 795, 1448, 1449, 1451, 1452, 1453, 1447, 1454, - 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, - 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, - 1471, 1472, 1473, 1475, 1476, 1477, 1478, 1479, - 1480, 795, 795, 1446, 1447, 1450, 1474, 1481, - 1446, 1046, 795, 795, 1483, 1484, 865, 846, - 1485, 846, 1486, 1487, 1488, 1489, 1490, 1491, - 1492, 1493, 1494, 1495, 1496, 920, 1497, 896, - 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, - 1506, 1507, 1508, 1509, 795, 795, 795, 801, - 941, 1482, 1046, 1510, 795, 795, 795, 1046, - 1510, 1046, 1046, 795, 1510, 795, 1510, 795, - 1510, 795, 1046, 1046, 1046, 1046, 1046, 1510, - 795, 1046, 1046, 1046, 795, 1046, 795, 1510, - 795, 1046, 1046, 1046, 1046, 795, 1510, 1046, - 795, 1046, 795, 1046, 795, 1046, 1046, 795, - 1046, 1510, 795, 1046, 795, 1046, 795, 1046, - 1510, 1046, 795, 1510, 1046, 795, 1046, 795, - 1510, 1046, 1046, 1046, 1046, 1046, 1510, 795, - 795, 1046, 795, 1046, 1510, 1046, 795, 1510, - 1046, 1046, 1510, 795, 795, 1046, 795, 1046, - 795, 1046, 1510, 1511, 1512, 1513, 1514, 1515, - 1516, 1517, 1518, 1519, 1520, 1521, 1091, 1522, - 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, - 1531, 1532, 1533, 1532, 1534, 1535, 1536, 1537, - 1538, 1047, 1510, 1539, 1540, 1541, 1542, 1543, - 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, - 1552, 1553, 1554, 1555, 1556, 1557, 1101, 1558, - 1559, 1560, 1068, 1561, 1562, 1563, 1564, 1565, - 1566, 1047, 1567, 1568, 1569, 1570, 1571, 1572, - 1573, 1574, 1050, 1575, 1047, 1050, 1576, 1577, - 1578, 1579, 1059, 1510, 1580, 1581, 1582, 1583, - 1079, 1584, 1585, 1059, 1586, 1587, 1588, 1589, - 1590, 1047, 1510, 1591, 1550, 1592, 1593, 1594, - 1059, 1595, 1596, 1050, 1047, 1059, 801, 1510, - 1560, 1047, 1050, 1059, 801, 1059, 801, 1597, - 1059, 1510, 801, 1050, 1598, 1599, 1050, 1600, - 1601, 1057, 1602, 1603, 1604, 1605, 1606, 1556, - 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, - 1615, 1616, 1617, 1618, 1575, 1619, 1050, 1059, - 801, 1510, 1620, 1621, 1059, 1047, 1510, 801, - 1047, 1510, 1050, 1622, 1107, 1623, 1624, 1625, - 1626, 1627, 1628, 1629, 1630, 1047, 1631, 1632, - 1633, 1634, 1635, 1636, 1047, 1059, 1510, 1638, - 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, - 1647, 1648, 1644, 1650, 1651, 1652, 1653, 1637, - 1649, 1637, 1510, 1637, 1510, + 1182, 1183, 1184, 1185, 1186, 1187, 1189, 1190, + 1191, 1192, 1193, 1194, 670, 1148, 7, 1148, + 419, 1148, 419, 1161, 1164, 1188, 1195, 1160, + 1142, 1142, 1196, 1143, 1197, 1199, 1198, 4, + 1147, 1201, 1198, 1202, 1198, 2, 1147, 1198, + 6, 8, 8, 7, 1203, 1204, 1198, 1205, + 1206, 1198, 1207, 1208, 1198, 1209, 1198, 419, + 419, 1211, 1212, 489, 470, 1213, 470, 1214, + 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, + 1223, 1224, 544, 1225, 520, 1226, 1227, 1228, + 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, + 1237, 419, 419, 419, 425, 565, 1210, 1238, + 1198, 1239, 1198, 670, 1240, 419, 419, 419, + 670, 1240, 670, 670, 419, 1240, 419, 1240, + 419, 1240, 419, 670, 670, 670, 670, 670, + 1240, 419, 670, 670, 670, 419, 670, 419, + 1240, 419, 670, 670, 670, 670, 419, 1240, + 670, 419, 670, 419, 670, 419, 670, 670, + 419, 670, 1240, 419, 670, 419, 670, 419, + 670, 1240, 670, 419, 1240, 670, 419, 670, + 419, 1240, 670, 670, 670, 670, 670, 1240, + 419, 419, 670, 419, 670, 1240, 670, 419, + 1240, 670, 670, 1240, 419, 419, 670, 419, + 670, 419, 670, 1240, 1241, 1242, 1243, 1244, + 1245, 1246, 1247, 1248, 1249, 1250, 1251, 715, + 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, + 1260, 1261, 1262, 1263, 1262, 1264, 1265, 1266, + 1267, 1268, 671, 1240, 1269, 1270, 1271, 1272, + 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, + 1281, 1282, 1283, 1284, 1285, 1286, 1287, 725, + 1288, 1289, 1290, 692, 1291, 1292, 1293, 1294, + 1295, 1296, 671, 1297, 1298, 1299, 1300, 1301, + 1302, 1303, 1304, 674, 1305, 671, 674, 1306, + 1307, 1308, 1309, 683, 1240, 1310, 1311, 1312, + 1313, 703, 1314, 1315, 683, 1316, 1317, 1318, + 1319, 1320, 671, 1240, 1321, 1280, 1322, 1323, + 1324, 683, 1325, 1326, 674, 671, 683, 425, + 1240, 1290, 671, 674, 683, 425, 683, 425, + 1327, 683, 1240, 425, 674, 1328, 1329, 674, + 1330, 1331, 681, 1332, 1333, 1334, 1335, 1336, + 1286, 1337, 1338, 1339, 1340, 1341, 1342, 1343, + 1344, 1345, 1346, 1347, 1348, 1305, 1349, 674, + 683, 425, 1240, 1350, 1351, 683, 671, 1240, + 425, 671, 1240, 674, 1352, 731, 1353, 1354, + 1355, 1356, 1357, 1358, 1359, 1360, 671, 1361, + 1362, 1363, 1364, 1365, 1366, 671, 683, 1240, + 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375, + 1376, 1377, 1378, 1374, 1380, 1381, 1382, 1383, + 1367, 1379, 1367, 1240, 1367, 1240, 1384, 1384, + 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, + 1389, 767, 1393, 1393, 1393, 1394, 1393, 1393, + 768, 769, 770, 1393, 767, 1384, 1384, 1395, + 1398, 1399, 1397, 1400, 1401, 1400, 1402, 1393, + 1404, 1403, 1398, 1405, 1397, 1407, 1406, 1396, + 1396, 1396, 768, 769, 770, 1396, 767, 767, + 1408, 773, 1408, 1409, 1408, 775, 1410, 1411, + 1412, 1413, 1414, 1415, 1416, 1413, 776, 775, + 1410, 1417, 1417, 777, 779, 1418, 1417, 776, + 1420, 1421, 1419, 1420, 1421, 1422, 1419, 775, + 1410, 1423, 1417, 775, 1410, 1417, 1425, 1424, + 1427, 1426, 776, 1428, 777, 1428, 779, 1428, + 785, 1429, 1430, 1431, 1432, 1433, 1434, 1435, + 1432, 786, 785, 1429, 1436, 1436, 787, 789, + 1437, 1436, 786, 1439, 1440, 1438, 1439, 1440, + 1441, 1438, 785, 1429, 1442, 1436, 785, 1429, + 1436, 1444, 1443, 1446, 1445, 786, 1447, 787, + 1447, 789, 1447, 795, 1450, 1451, 1453, 1454, + 1455, 1449, 1456, 1457, 1458, 1459, 1460, 1461, + 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, + 1470, 1471, 1472, 1473, 1474, 1475, 1477, 1478, + 1479, 1480, 1481, 1482, 795, 795, 1448, 1449, + 1452, 1476, 1483, 1448, 1046, 795, 795, 1485, + 1486, 865, 846, 1487, 846, 1488, 1489, 1490, + 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, + 920, 1499, 896, 1500, 1501, 1502, 1503, 1504, + 1505, 1506, 1507, 1508, 1509, 1510, 1511, 795, + 795, 795, 801, 941, 1484, 1046, 1512, 795, + 795, 795, 1046, 1512, 1046, 1046, 795, 1512, + 795, 1512, 795, 1512, 795, 1046, 1046, 1046, + 1046, 1046, 1512, 795, 1046, 1046, 1046, 795, + 1046, 795, 1512, 795, 1046, 1046, 1046, 1046, + 795, 1512, 1046, 795, 1046, 795, 1046, 795, + 1046, 1046, 795, 1046, 1512, 795, 1046, 795, + 1046, 795, 1046, 1512, 1046, 795, 1512, 1046, + 795, 1046, 795, 1512, 1046, 1046, 1046, 1046, + 1046, 1512, 795, 795, 1046, 795, 1046, 1512, + 1046, 795, 1512, 1046, 1046, 1512, 795, 795, + 1046, 795, 1046, 795, 1046, 1512, 1513, 1514, + 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, + 1523, 1091, 1524, 1525, 1526, 1527, 1528, 1529, + 1530, 1531, 1532, 1533, 1534, 1535, 1534, 1536, + 1537, 1538, 1539, 1540, 1047, 1512, 1541, 1542, + 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, + 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, + 1559, 1101, 1560, 1561, 1562, 1068, 1563, 1564, + 1565, 1566, 1567, 1568, 1047, 1569, 1570, 1571, + 1572, 1573, 1574, 1575, 1576, 1050, 1577, 1047, + 1050, 1578, 1579, 1580, 1581, 1059, 1512, 1582, + 1583, 1584, 1585, 1079, 1586, 1587, 1059, 1588, + 1589, 1590, 1591, 1592, 1047, 1512, 1593, 1552, + 1594, 1595, 1596, 1059, 1597, 1598, 1050, 1047, + 1059, 801, 1512, 1562, 1047, 1050, 1059, 801, + 1059, 801, 1599, 1059, 1512, 801, 1050, 1600, + 1601, 1050, 1602, 1603, 1057, 1604, 1605, 1606, + 1607, 1608, 1558, 1609, 1610, 1611, 1612, 1613, + 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1577, + 1621, 1050, 1059, 801, 1512, 1622, 1623, 1059, + 1047, 1512, 801, 1047, 1512, 1050, 1624, 1107, + 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, + 1047, 1633, 1634, 1635, 1636, 1637, 1638, 1047, + 1059, 1512, 1640, 1641, 1642, 1643, 1644, 1645, + 1646, 1647, 1648, 1649, 1650, 1646, 1652, 1653, + 1654, 1655, 1639, 1651, 1639, 1512, 1639, 1512, } var _hcltok_trans_targs []int16 = []int16{ @@ -3238,7 +3237,7 @@ var _hcltok_trans_targs []int16 = []int16{ 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 405, 406, 407, 408, 410, - 412, 414, 1459, 1471, 1459, 437, 438, 439, + 412, 414, 1459, 1472, 1459, 437, 438, 439, 440, 417, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, @@ -3281,11 +3280,11 @@ var _hcltok_trans_targs []int16 = []int16{ 888, 889, 890, 891, 892, 895, 896, 898, 899, 900, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 914, 915, 916, - 917, 920, 922, 923, 925, 927, 1509, 1510, - 929, 930, 931, 1509, 1509, 932, 1523, 1523, - 1524, 935, 1523, 936, 1525, 1526, 1529, 1530, - 1534, 1534, 1535, 941, 1534, 942, 1536, 1537, - 1540, 1541, 1545, 1546, 1545, 968, 969, 970, + 917, 920, 922, 923, 925, 927, 1510, 1511, + 929, 930, 931, 1510, 1510, 932, 1524, 1524, + 1525, 935, 1524, 936, 1526, 1527, 1530, 1531, + 1535, 1535, 1536, 941, 1535, 942, 1537, 1538, + 1541, 1542, 1546, 1547, 1546, 968, 969, 970, 971, 948, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, @@ -3316,7 +3315,7 @@ var _hcltok_trans_targs []int16 = []int16{ 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1204, 1205, 1206, 1207, 1208, 1209, 1211, - 1213, 1215, 1217, 1219, 1220, 1545, 1545, 1221, + 1213, 1215, 1217, 1219, 1220, 1546, 1546, 1221, 1358, 1359, 1290, 1360, 1361, 1362, 1363, 1364, 1365, 1319, 1366, 1255, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1275, 1375, 1376, 1377, @@ -3330,78 +3329,78 @@ var _hcltok_trans_targs []int16 = []int16{ 1439, 1440, 1441, 1442, 1443, 1445, 1446, 1447, 1448, 1451, 1453, 1454, 1456, 1458, 1460, 1459, 1461, 1462, 1459, 1463, 1459, 1464, 1465, 1466, - 1468, 1469, 1470, 1459, 1472, 1459, 1473, 1459, - 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, + 1468, 1469, 1470, 1471, 1459, 1473, 1459, 1474, + 1459, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, - 1506, 1507, 1508, 1459, 1459, 1459, 1459, 1459, - 1459, 1, 1459, 7, 1459, 1459, 1459, 1459, - 1459, 415, 416, 420, 421, 422, 423, 424, - 425, 426, 427, 428, 429, 430, 431, 433, - 435, 436, 468, 509, 524, 531, 533, 535, - 555, 558, 574, 687, 1459, 1459, 1459, 691, - 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 703, 704, 705, 706, 707, 708, - 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 725, - 726, 727, 728, 729, 730, 731, 732, 733, - 734, 735, 736, 737, 738, 739, 741, 742, - 743, 745, 746, 747, 748, 749, 750, 751, - 752, 753, 754, 755, 756, 757, 758, 760, - 761, 762, 763, 764, 765, 766, 767, 768, - 770, 771, 772, 773, 774, 775, 776, 777, - 778, 779, 780, 781, 782, 783, 784, 785, - 786, 787, 789, 790, 791, 792, 793, 794, - 795, 796, 797, 798, 799, 800, 801, 802, - 803, 804, 805, 806, 807, 808, 809, 811, - 812, 813, 814, 815, 816, 817, 818, 819, - 820, 821, 822, 823, 824, 825, 826, 855, - 880, 883, 884, 886, 893, 894, 897, 901, - 913, 918, 919, 921, 924, 926, 1511, 1509, - 1512, 1517, 1519, 1509, 1520, 1521, 1522, 1509, - 928, 1509, 1509, 1513, 1514, 1516, 1509, 1515, - 1509, 1509, 1509, 1518, 1509, 1509, 1509, 933, - 934, 938, 939, 1523, 1531, 1532, 1533, 1523, - 937, 1523, 1523, 934, 1527, 1528, 1523, 1523, - 1523, 1523, 1523, 940, 944, 945, 1534, 1542, - 1543, 1544, 1534, 943, 1534, 1534, 940, 1538, - 1539, 1534, 1534, 1534, 1534, 1534, 1545, 1547, - 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, - 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, - 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, - 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, - 1580, 1581, 1545, 946, 947, 951, 952, 953, - 954, 955, 956, 957, 958, 959, 960, 961, - 962, 964, 966, 967, 999, 1040, 1055, 1062, - 1064, 1066, 1086, 1089, 1105, 1218, 1545, 1222, - 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, - 1231, 1232, 1234, 1235, 1236, 1237, 1238, 1239, - 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1247, - 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1256, - 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, - 1265, 1266, 1267, 1268, 1269, 1270, 1272, 1273, - 1274, 1276, 1277, 1278, 1279, 1280, 1281, 1282, - 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1291, - 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, - 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, - 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, - 1317, 1318, 1320, 1321, 1322, 1323, 1324, 1325, - 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, - 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1342, - 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, - 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1386, - 1411, 1414, 1415, 1417, 1424, 1425, 1428, 1432, - 1444, 1449, 1450, 1452, 1455, 1457, + 1506, 1507, 1508, 1509, 1459, 1459, 1459, 1459, + 1459, 1459, 1, 1459, 1459, 7, 1459, 1459, + 1459, 1459, 1459, 415, 416, 420, 421, 422, + 423, 424, 425, 426, 427, 428, 429, 430, + 431, 433, 435, 436, 468, 509, 524, 531, + 533, 535, 555, 558, 574, 687, 1459, 1459, + 1459, 691, 692, 693, 694, 695, 696, 697, + 698, 699, 700, 701, 703, 704, 705, 706, + 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, + 723, 725, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 736, 737, 738, 739, + 741, 742, 743, 745, 746, 747, 748, 749, + 750, 751, 752, 753, 754, 755, 756, 757, + 758, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 770, 771, 772, 773, 774, 775, + 776, 777, 778, 779, 780, 781, 782, 783, + 784, 785, 786, 787, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, + 801, 802, 803, 804, 805, 806, 807, 808, + 809, 811, 812, 813, 814, 815, 816, 817, + 818, 819, 820, 821, 822, 823, 824, 825, + 826, 855, 880, 883, 884, 886, 893, 894, + 897, 901, 913, 918, 919, 921, 924, 926, + 1512, 1510, 1513, 1518, 1520, 1510, 1521, 1522, + 1523, 1510, 928, 1510, 1510, 1514, 1515, 1517, + 1510, 1516, 1510, 1510, 1510, 1519, 1510, 1510, + 1510, 933, 934, 938, 939, 1524, 1532, 1533, + 1534, 1524, 937, 1524, 1524, 934, 1528, 1529, + 1524, 1524, 1524, 1524, 1524, 940, 944, 945, + 1535, 1543, 1544, 1545, 1535, 943, 1535, 1535, + 940, 1539, 1540, 1535, 1535, 1535, 1535, 1535, + 1546, 1548, 1549, 1550, 1551, 1552, 1553, 1554, + 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, + 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, + 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, + 1579, 1580, 1581, 1582, 1546, 946, 947, 951, + 952, 953, 954, 955, 956, 957, 958, 959, + 960, 961, 962, 964, 966, 967, 999, 1040, + 1055, 1062, 1064, 1066, 1086, 1089, 1105, 1218, + 1546, 1222, 1223, 1224, 1225, 1226, 1227, 1228, + 1229, 1230, 1231, 1232, 1234, 1235, 1236, 1237, + 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, + 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, + 1254, 1256, 1257, 1258, 1259, 1260, 1261, 1262, + 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, + 1272, 1273, 1274, 1276, 1277, 1278, 1279, 1280, + 1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, + 1289, 1291, 1292, 1293, 1294, 1295, 1296, 1297, + 1298, 1299, 1301, 1302, 1303, 1304, 1305, 1306, + 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, + 1315, 1316, 1317, 1318, 1320, 1321, 1322, 1323, + 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, + 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, + 1340, 1342, 1343, 1344, 1345, 1346, 1347, 1348, + 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, + 1357, 1386, 1411, 1414, 1415, 1417, 1424, 1425, + 1428, 1432, 1444, 1449, 1450, 1452, 1455, 1457, } var _hcltok_trans_actions []byte = []byte{ - 145, 107, 0, 0, 91, 141, 0, 7, + 147, 109, 0, 0, 91, 143, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 121, 0, 0, 0, + 0, 0, 0, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3448,7 +3447,7 @@ var _hcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 143, 193, 149, 0, 0, 0, + 0, 0, 145, 195, 151, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3479,7 +3478,7 @@ var _hcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 147, 125, 0, + 0, 0, 0, 0, 0, 149, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3491,11 +3490,11 @@ var _hcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 31, 169, + 0, 0, 0, 0, 0, 0, 31, 171, 0, 0, 0, 35, 33, 0, 55, 41, - 175, 0, 53, 0, 175, 175, 0, 0, - 75, 61, 181, 0, 73, 0, 181, 181, - 0, 0, 85, 187, 89, 0, 0, 0, + 177, 0, 53, 0, 177, 177, 0, 0, + 75, 61, 183, 0, 73, 0, 183, 183, + 0, 0, 85, 189, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3539,18 +3538,19 @@ var _hcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, - 0, 0, 119, 0, 111, 0, 7, 7, - 7, 0, 0, 113, 0, 115, 0, 123, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 121, 0, 113, 0, 7, 7, + 0, 7, 0, 0, 115, 0, 117, 0, + 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 7, 7, - 7, 196, 196, 196, 196, 196, 196, 7, - 7, 196, 7, 127, 139, 135, 97, 133, - 103, 0, 129, 0, 101, 95, 109, 99, - 131, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7, + 7, 7, 198, 198, 198, 198, 198, 198, + 7, 7, 198, 7, 129, 141, 137, 97, + 135, 103, 0, 131, 107, 0, 101, 95, + 111, 99, 133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 105, 117, 137, 0, + 0, 0, 0, 0, 0, 0, 105, 119, + 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3568,23 +3568,23 @@ var _hcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 13, - 0, 0, 172, 17, 0, 7, 7, 23, - 0, 25, 27, 0, 0, 0, 151, 0, - 15, 19, 9, 0, 21, 11, 29, 0, - 0, 0, 0, 43, 0, 178, 178, 49, - 0, 157, 154, 1, 175, 175, 45, 37, - 47, 39, 51, 0, 0, 0, 63, 0, - 184, 184, 69, 0, 163, 160, 1, 181, - 181, 65, 57, 67, 59, 71, 77, 0, + 0, 13, 0, 0, 174, 17, 0, 7, + 7, 23, 0, 25, 27, 0, 0, 0, + 153, 0, 15, 19, 9, 0, 21, 11, + 29, 0, 0, 0, 0, 43, 0, 180, + 180, 49, 0, 159, 156, 1, 177, 177, + 45, 37, 47, 39, 51, 0, 0, 0, + 63, 0, 186, 186, 69, 0, 165, 162, + 1, 183, 183, 65, 57, 67, 59, 71, + 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7, + 7, 7, 192, 192, 192, 192, 192, 192, + 7, 7, 192, 7, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 7, 7, 7, - 190, 190, 190, 190, 190, 190, 7, 7, - 190, 7, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 83, 0, + 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3602,7 +3602,6 @@ var _hcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, } var _hcltok_to_state_actions []byte = []byte{ @@ -3794,16 +3793,16 @@ var _hcltok_to_state_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 166, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 166, 0, + 0, 0, 0, 0, 168, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 168, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, } var _hcltok_from_state_actions []byte = []byte{ @@ -3995,16 +3994,16 @@ var _hcltok_from_state_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 5, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 5, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, } var _hcltok_eof_trans []int16 = []int16{ @@ -4190,35 +4189,35 @@ var _hcltok_eof_trans []int16 = []int16{ 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 0, 1196, 1197, 1198, 1200, - 1198, 1198, 1198, 1203, 1198, 1198, 1198, 1209, - 1198, 1198, 1239, 1239, 1239, 1239, 1239, 1239, - 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, - 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, - 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, - 1239, 1239, 1239, 1239, 1239, 0, 1392, 1394, - 1395, 1399, 1399, 1392, 1402, 1395, 1405, 1395, - 1407, 1407, 1407, 0, 1416, 1418, 1418, 1416, - 1416, 1423, 1425, 1427, 1427, 1427, 0, 1435, - 1437, 1437, 1435, 1435, 1442, 1444, 1446, 1446, - 1446, 0, 1483, 1511, 1511, 1511, 1511, 1511, - 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, - 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, - 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, - 1511, 1511, 1511, 1511, 1511, 1511, + 1046, 1046, 1046, 0, 1197, 1198, 1199, 1201, + 1199, 1199, 1199, 1204, 1199, 1199, 1199, 1199, + 1211, 1199, 1199, 1241, 1241, 1241, 1241, 1241, + 1241, 1241, 1241, 1241, 1241, 1241, 1241, 1241, + 1241, 1241, 1241, 1241, 1241, 1241, 1241, 1241, + 1241, 1241, 1241, 1241, 1241, 1241, 1241, 1241, + 1241, 1241, 1241, 1241, 1241, 1241, 0, 1394, + 1396, 1397, 1401, 1401, 1394, 1404, 1397, 1407, + 1397, 1409, 1409, 1409, 0, 1418, 1420, 1420, + 1418, 1418, 1425, 1427, 1429, 1429, 1429, 0, + 1437, 1439, 1439, 1437, 1437, 1444, 1446, 1448, + 1448, 1448, 0, 1485, 1513, 1513, 1513, 1513, + 1513, 1513, 1513, 1513, 1513, 1513, 1513, 1513, + 1513, 1513, 1513, 1513, 1513, 1513, 1513, 1513, + 1513, 1513, 1513, 1513, 1513, 1513, 1513, 1513, + 1513, 1513, 1513, 1513, 1513, 1513, 1513, } const hcltok_start int = 1459 const hcltok_first_final int = 1459 const hcltok_error int = 0 -const hcltok_en_stringTemplate int = 1509 -const hcltok_en_heredocTemplate int = 1523 -const hcltok_en_bareTemplate int = 1534 -const hcltok_en_identOnly int = 1545 +const hcltok_en_stringTemplate int = 1510 +const hcltok_en_heredocTemplate int = 1524 +const hcltok_en_bareTemplate int = 1535 +const hcltok_en_identOnly int = 1546 const hcltok_en_main int = 1459 -//line scan_tokens.rl:16 +//line scan_tokens.rl:18 func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []Token { stripData := stripUTF8BOM(data) @@ -4232,7 +4231,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To StartByte: start.Byte, } -//line scan_tokens.rl:305 +//line scan_tokens.rl:317 // Ragel state p := 0 // "Pointer" into data @@ -4260,7 +4259,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To var retBraces []int // stack of brace levels that cause us to use fret var heredocs []heredocInProgress // stack of heredocs we're currently processing -//line scan_tokens.rl:340 +//line scan_tokens.rl:352 // Make Go compiler happy _ = ts @@ -4280,7 +4279,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To f.emitToken(TokenType(b[0]), ts, te) } -//line scan_tokens.go:4289 +//line scan_tokens.go:4292 { top = 0 ts = 0 @@ -4288,7 +4287,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To act = 0 } -//line scan_tokens.go:4297 +//line scan_tokens.go:4300 { var _klen int var _trans int @@ -4312,7 +4311,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To //line NONE:1 ts = p -//line scan_tokens.go:4320 +//line scan_tokens.go:4323 } } @@ -4384,7 +4383,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To _acts++ switch _hcltok_actions[_acts-1] { case 0: -//line scan_tokens.rl:224 +//line scan_tokens.rl:235 p-- case 4: @@ -4392,13 +4391,13 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To te = p + 1 case 5: -//line scan_tokens.rl:248 +//line scan_tokens.rl:259 act = 4 case 6: -//line scan_tokens.rl:250 +//line scan_tokens.rl:261 act = 6 case 7: -//line scan_tokens.rl:160 +//line scan_tokens.rl:171 te = p + 1 { token(TokenTemplateInterp) @@ -4416,7 +4415,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 8: -//line scan_tokens.rl:170 +//line scan_tokens.rl:181 te = p + 1 { token(TokenTemplateControl) @@ -4434,7 +4433,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 9: -//line scan_tokens.rl:84 +//line scan_tokens.rl:95 te = p + 1 { token(TokenCQuote) @@ -4447,19 +4446,19 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } case 10: -//line scan_tokens.rl:248 +//line scan_tokens.rl:259 te = p + 1 { token(TokenQuotedLit) } case 11: -//line scan_tokens.rl:251 +//line scan_tokens.rl:262 te = p + 1 { token(TokenBadUTF8) } case 12: -//line scan_tokens.rl:160 +//line scan_tokens.rl:171 te = p p-- { @@ -4478,7 +4477,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 13: -//line scan_tokens.rl:170 +//line scan_tokens.rl:181 te = p p-- { @@ -4497,41 +4496,41 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 14: -//line scan_tokens.rl:248 +//line scan_tokens.rl:259 te = p p-- { token(TokenQuotedLit) } case 15: -//line scan_tokens.rl:249 +//line scan_tokens.rl:260 te = p p-- { token(TokenQuotedNewline) } case 16: -//line scan_tokens.rl:250 +//line scan_tokens.rl:261 te = p p-- { token(TokenInvalid) } case 17: -//line scan_tokens.rl:251 +//line scan_tokens.rl:262 te = p p-- { token(TokenBadUTF8) } case 18: -//line scan_tokens.rl:248 +//line scan_tokens.rl:259 p = (te) - 1 { token(TokenQuotedLit) } case 19: -//line scan_tokens.rl:251 +//line scan_tokens.rl:262 p = (te) - 1 { token(TokenBadUTF8) @@ -4552,13 +4551,13 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } case 21: -//line scan_tokens.rl:148 +//line scan_tokens.rl:159 act = 11 case 22: -//line scan_tokens.rl:259 +//line scan_tokens.rl:270 act = 12 case 23: -//line scan_tokens.rl:160 +//line scan_tokens.rl:171 te = p + 1 { token(TokenTemplateInterp) @@ -4576,7 +4575,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 24: -//line scan_tokens.rl:170 +//line scan_tokens.rl:181 te = p + 1 { token(TokenTemplateControl) @@ -4594,7 +4593,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 25: -//line scan_tokens.rl:111 +//line scan_tokens.rl:122 te = p + 1 { // This action is called specificially when a heredoc literal @@ -4639,13 +4638,13 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenStringLit) } case 26: -//line scan_tokens.rl:259 +//line scan_tokens.rl:270 te = p + 1 { token(TokenBadUTF8) } case 27: -//line scan_tokens.rl:160 +//line scan_tokens.rl:171 te = p p-- { @@ -4664,7 +4663,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 28: -//line scan_tokens.rl:170 +//line scan_tokens.rl:181 te = p p-- { @@ -4683,7 +4682,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 29: -//line scan_tokens.rl:148 +//line scan_tokens.rl:159 te = p p-- { @@ -4694,14 +4693,14 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenStringLit) } case 30: -//line scan_tokens.rl:259 +//line scan_tokens.rl:270 te = p p-- { token(TokenBadUTF8) } case 31: -//line scan_tokens.rl:148 +//line scan_tokens.rl:159 p = (te) - 1 { // This action is called when a heredoc literal _doesn't_ end @@ -4736,13 +4735,13 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } case 33: -//line scan_tokens.rl:156 +//line scan_tokens.rl:167 act = 15 case 34: -//line scan_tokens.rl:266 +//line scan_tokens.rl:277 act = 16 case 35: -//line scan_tokens.rl:160 +//line scan_tokens.rl:171 te = p + 1 { token(TokenTemplateInterp) @@ -4760,7 +4759,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 36: -//line scan_tokens.rl:170 +//line scan_tokens.rl:181 te = p + 1 { token(TokenTemplateControl) @@ -4778,19 +4777,19 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 37: -//line scan_tokens.rl:156 +//line scan_tokens.rl:167 te = p + 1 { token(TokenStringLit) } case 38: -//line scan_tokens.rl:266 +//line scan_tokens.rl:277 te = p + 1 { token(TokenBadUTF8) } case 39: -//line scan_tokens.rl:160 +//line scan_tokens.rl:171 te = p p-- { @@ -4809,7 +4808,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 40: -//line scan_tokens.rl:170 +//line scan_tokens.rl:181 te = p p-- { @@ -4828,21 +4827,21 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 41: -//line scan_tokens.rl:156 +//line scan_tokens.rl:167 te = p p-- { token(TokenStringLit) } case 42: -//line scan_tokens.rl:266 +//line scan_tokens.rl:277 te = p p-- { token(TokenBadUTF8) } case 43: -//line scan_tokens.rl:156 +//line scan_tokens.rl:167 p = (te) - 1 { token(TokenStringLit) @@ -4869,45 +4868,45 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } case 45: -//line scan_tokens.rl:270 +//line scan_tokens.rl:281 act = 17 case 46: -//line scan_tokens.rl:271 +//line scan_tokens.rl:282 act = 18 case 47: -//line scan_tokens.rl:271 +//line scan_tokens.rl:282 te = p + 1 { token(TokenBadUTF8) } case 48: -//line scan_tokens.rl:272 +//line scan_tokens.rl:283 te = p + 1 { token(TokenInvalid) } case 49: -//line scan_tokens.rl:270 +//line scan_tokens.rl:281 te = p p-- { token(TokenIdent) } case 50: -//line scan_tokens.rl:271 +//line scan_tokens.rl:282 te = p p-- { token(TokenBadUTF8) } case 51: -//line scan_tokens.rl:270 +//line scan_tokens.rl:281 p = (te) - 1 { token(TokenIdent) } case 52: -//line scan_tokens.rl:271 +//line scan_tokens.rl:282 p = (te) - 1 { token(TokenBadUTF8) @@ -4928,86 +4927,92 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } case 54: -//line scan_tokens.rl:278 +//line scan_tokens.rl:289 act = 22 case 55: -//line scan_tokens.rl:301 - act = 39 +//line scan_tokens.rl:313 + act = 40 case 56: -//line scan_tokens.rl:280 +//line scan_tokens.rl:291 te = p + 1 { token(TokenComment) } case 57: -//line scan_tokens.rl:281 +//line scan_tokens.rl:292 te = p + 1 { token(TokenNewline) } case 58: -//line scan_tokens.rl:283 +//line scan_tokens.rl:294 te = p + 1 { token(TokenEqualOp) } case 59: -//line scan_tokens.rl:284 +//line scan_tokens.rl:295 te = p + 1 { token(TokenNotEqual) } case 60: -//line scan_tokens.rl:285 +//line scan_tokens.rl:296 te = p + 1 { token(TokenGreaterThanEq) } case 61: -//line scan_tokens.rl:286 +//line scan_tokens.rl:297 te = p + 1 { token(TokenLessThanEq) } case 62: -//line scan_tokens.rl:287 +//line scan_tokens.rl:298 te = p + 1 { token(TokenAnd) } case 63: -//line scan_tokens.rl:288 +//line scan_tokens.rl:299 te = p + 1 { token(TokenOr) } case 64: -//line scan_tokens.rl:289 +//line scan_tokens.rl:300 te = p + 1 { - token(TokenEllipsis) + token(TokenDoubleColon) } case 65: -//line scan_tokens.rl:290 +//line scan_tokens.rl:301 te = p + 1 { - token(TokenFatArrow) + token(TokenEllipsis) } case 66: -//line scan_tokens.rl:291 +//line scan_tokens.rl:302 te = p + 1 { - selfToken() + token(TokenFatArrow) } case 67: -//line scan_tokens.rl:180 +//line scan_tokens.rl:303 + te = p + 1 + { + selfToken() + } + case 68: +//line scan_tokens.rl:191 te = p + 1 { token(TokenOBrace) braces++ } - case 68: -//line scan_tokens.rl:185 + case 69: +//line scan_tokens.rl:196 te = p + 1 { if len(retBraces) > 0 && retBraces[len(retBraces)-1] == braces { @@ -5026,8 +5031,8 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To braces-- } } - case 69: -//line scan_tokens.rl:197 + case 70: +//line scan_tokens.rl:208 te = p + 1 { // Only consume from the retBraces stack and return if we are at @@ -5055,8 +5060,8 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To braces-- } } - case 70: -//line scan_tokens.rl:79 + case 71: +//line scan_tokens.rl:90 te = p + 1 { token(TokenOQuote) @@ -5064,12 +5069,12 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To stack = append(stack, 0) stack[top] = cs top++ - cs = 1509 + cs = 1510 goto _again } } - case 71: -//line scan_tokens.rl:89 + case 72: +//line scan_tokens.rl:100 te = p + 1 { token(TokenOHeredoc) @@ -5094,94 +5099,94 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To stack = append(stack, 0) stack[top] = cs top++ - cs = 1523 + cs = 1524 goto _again } } - case 72: -//line scan_tokens.rl:301 + case 73: +//line scan_tokens.rl:313 te = p + 1 { token(TokenBadUTF8) } - case 73: -//line scan_tokens.rl:302 + case 74: +//line scan_tokens.rl:314 te = p + 1 { token(TokenInvalid) } - case 74: -//line scan_tokens.rl:276 + case 75: +//line scan_tokens.rl:287 te = p p-- - case 75: -//line scan_tokens.rl:277 + case 76: +//line scan_tokens.rl:288 te = p p-- { token(TokenNumberLit) } - case 76: -//line scan_tokens.rl:278 + case 77: +//line scan_tokens.rl:289 te = p p-- { token(TokenIdent) } - case 77: -//line scan_tokens.rl:280 + case 78: +//line scan_tokens.rl:291 te = p p-- { token(TokenComment) } - case 78: -//line scan_tokens.rl:291 + case 79: +//line scan_tokens.rl:303 te = p p-- { selfToken() } - case 79: -//line scan_tokens.rl:301 + case 80: +//line scan_tokens.rl:313 te = p p-- { token(TokenBadUTF8) } - case 80: -//line scan_tokens.rl:302 + case 81: +//line scan_tokens.rl:314 te = p p-- { token(TokenInvalid) } - case 81: -//line scan_tokens.rl:277 + case 82: +//line scan_tokens.rl:288 p = (te) - 1 { token(TokenNumberLit) } - case 82: -//line scan_tokens.rl:278 + case 83: +//line scan_tokens.rl:289 p = (te) - 1 { token(TokenIdent) } - case 83: -//line scan_tokens.rl:291 + case 84: +//line scan_tokens.rl:303 p = (te) - 1 { selfToken() } - case 84: -//line scan_tokens.rl:301 + case 85: +//line scan_tokens.rl:313 p = (te) - 1 { token(TokenBadUTF8) } - case 85: + case 86: //line NONE:1 switch act { case 22: @@ -5189,14 +5194,14 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To p = (te) - 1 token(TokenIdent) } - case 39: + case 40: { p = (te) - 1 token(TokenBadUTF8) } } -//line scan_tokens.go:5055 +//line scan_tokens.go:5062 } } @@ -5215,7 +5220,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To //line NONE:1 act = 0 -//line scan_tokens.go:5073 +//line scan_tokens.go:5080 } } @@ -5241,7 +5246,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } -//line scan_tokens.rl:363 +//line scan_tokens.rl:375 // If we fall out here without being in a final state then we've // encountered something that the scanner can't match, which we'll diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.rl b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.rl index 942ad92ba1eb..66bb47146c92 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.rl +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.rl @@ -1,3 +1,5 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 package hclsyntax @@ -53,6 +55,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To LogicalAnd = "&&"; LogicalOr = "||"; + DoubleColon = "::"; Ellipsis = "..."; FatArrow = "=>"; @@ -294,6 +297,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To LessThanEqual => { token(TokenLessThanEq); }; LogicalAnd => { token(TokenAnd); }; LogicalOr => { token(TokenOr); }; + DoubleColon => { token(TokenDoubleColon); }; Ellipsis => { token(TokenEllipsis); }; FatArrow => { token(TokenFatArrow); }; SelfToken => { selfToken() }; diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md index 6d31e3525504..88925410ab75 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md @@ -668,7 +668,7 @@ a == b equal a != b not equal ``` -Two values are equal if the are of identical types and their values are +Two values are equal if they are of identical types and their values are equal as defined in the HCL syntax-agnostic information model. The equality operators are commutative and opposite, such that `(a == b) == !(a != b)` and `(a == b) == (b == a)` for all values `a` and `b`. diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go index afde5f33a0bb..47648b8f006b 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go @@ -63,8 +63,9 @@ const ( TokenDot TokenType = '.' TokenComma TokenType = ',' - TokenEllipsis TokenType = '…' - TokenFatArrow TokenType = '⇒' + TokenDoubleColon TokenType = '⸬' + TokenEllipsis TokenType = '…' + TokenFatArrow TokenType = '⇒' TokenQuestion TokenType = '?' TokenColon TokenType = ':' diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token_type_string.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token_type_string.go index c23c4f0b7a46..1453389cff53 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token_type_string.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token_type_string.go @@ -1,11 +1,11 @@ -// Code generated by "stringer -type TokenType -output token_type_string.go"; DO NOT EDIT. +// Code generated by "stringer -type TokenType -output token_type_string.go token_type.go"; DO NOT EDIT. package hclsyntax import "strconv" func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. + // An "invalid array index" compiler error signifies that the constant values (55) have changed. // Re-run the stringer command to generate them again. var x [1]struct{} _ = x[TokenOBrace-123] @@ -35,6 +35,7 @@ func _() { _ = x[TokenBang-33] _ = x[TokenDot-46] _ = x[TokenComma-44] + _ = x[TokenDoubleColon-11820] _ = x[TokenEllipsis-8230] _ = x[TokenFatArrow-8658] _ = x[TokenQuestion-63] @@ -64,7 +65,7 @@ func _() { _ = x[TokenNil-0] } -const _TokenType_name = "TokenNilTokenNewlineTokenBangTokenPercentTokenBitwiseAndTokenApostropheTokenOParenTokenCParenTokenStarTokenPlusTokenCommaTokenMinusTokenDotTokenSlashTokenColonTokenSemicolonTokenLessThanTokenEqualTokenGreaterThanTokenQuestionTokenCommentTokenOHeredocTokenIdentTokenNumberLitTokenQuotedLitTokenStringLitTokenOBrackTokenCBrackTokenBitwiseXorTokenBacktickTokenCHeredocTokenOBraceTokenBitwiseOrTokenCBraceTokenBitwiseNotTokenOQuoteTokenCQuoteTokenTemplateControlTokenEllipsisTokenFatArrowTokenTemplateSeqEndTokenAndTokenOrTokenTemplateInterpTokenEqualOpTokenNotEqualTokenLessThanEqTokenGreaterThanEqTokenEOFTokenTabsTokenQuotedNewlineTokenStarStarTokenInvalidTokenBadUTF8" +const _TokenType_name = "TokenNilTokenNewlineTokenBangTokenPercentTokenBitwiseAndTokenApostropheTokenOParenTokenCParenTokenStarTokenPlusTokenCommaTokenMinusTokenDotTokenSlashTokenColonTokenSemicolonTokenLessThanTokenEqualTokenGreaterThanTokenQuestionTokenCommentTokenOHeredocTokenIdentTokenNumberLitTokenQuotedLitTokenStringLitTokenOBrackTokenCBrackTokenBitwiseXorTokenBacktickTokenCHeredocTokenOBraceTokenBitwiseOrTokenCBraceTokenBitwiseNotTokenOQuoteTokenCQuoteTokenTemplateControlTokenEllipsisTokenFatArrowTokenTemplateSeqEndTokenAndTokenOrTokenTemplateInterpTokenEqualOpTokenNotEqualTokenLessThanEqTokenGreaterThanEqTokenEOFTokenTabsTokenQuotedNewlineTokenStarStarTokenDoubleColonTokenInvalidTokenBadUTF8" var _TokenType_map = map[TokenType]string{ 0: _TokenType_name[0:8], @@ -119,8 +120,9 @@ var _TokenType_map = map[TokenType]string{ 9225: _TokenType_name[603:612], 9252: _TokenType_name[612:630], 10138: _TokenType_name[630:643], - 65533: _TokenType_name[643:655], - 128169: _TokenType_name[655:667], + 11820: _TokenType_name[643:659], + 65533: _TokenType_name[659:671], + 128169: _TokenType_name[671:683], } func (i TokenType) String() string { diff --git a/vendor/github.com/hashicorp/hcl/v2/tools.go b/vendor/github.com/hashicorp/hcl/v2/tools.go new file mode 100644 index 000000000000..e8c42ad1f65e --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/tools.go @@ -0,0 +1,11 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +//go:build tools +// +build tools + +package hcl + +import ( + _ "golang.org/x/tools/cmd/stringer" +) diff --git a/vendor/github.com/zclconf/go-cty/cty/convert/conversion_dynamic.go b/vendor/github.com/zclconf/go-cty/cty/convert/conversion_dynamic.go index 3b554e01b661..95f3925b599b 100644 --- a/vendor/github.com/zclconf/go-cty/cty/convert/conversion_dynamic.go +++ b/vendor/github.com/zclconf/go-cty/cty/convert/conversion_dynamic.go @@ -40,6 +40,11 @@ func dynamicPassthrough(in cty.Value, path cty.Path) (cty.Value, error) { // perspective, and will panic if it finds that they are not. For example if // in is an object and out is a map, this function will still attempt to iterate // through both as if they were the same. +// While the outermost in and out types may be compatible from a Convert +// perspective, inner types may not match when converting between maps and +// objects with optional attributes when the optional attributes don't match +// the map element type. Therefor in the case of a non-primitive type mismatch, +// we have to assume conversion was possible and pass the out type through. func dynamicReplace(in, out cty.Type) cty.Type { if in == cty.DynamicPseudoType || in == cty.NilType { // Short circuit this case, there's no point worrying about this if in @@ -56,11 +61,9 @@ func dynamicReplace(in, out cty.Type) cty.Type { // return it unchanged. return out case out.IsMapType(): - var elemType cty.Type - // Maps are compatible with other maps or objects. if in.IsMapType() { - elemType = dynamicReplace(in.ElementType(), out.ElementType()) + return cty.Map(dynamicReplace(in.ElementType(), out.ElementType())) } if in.IsObjectType() { @@ -69,10 +72,10 @@ func dynamicReplace(in, out cty.Type) cty.Type { types = append(types, t) } unifiedType, _ := unify(types, true) - elemType = dynamicReplace(unifiedType, out.ElementType()) + return cty.Map(dynamicReplace(unifiedType, out.ElementType())) } - return cty.Map(elemType) + return out case out.IsObjectType(): // Objects are compatible with other objects and maps. outTypes := map[string]cty.Type{} @@ -97,33 +100,29 @@ func dynamicReplace(in, out cty.Type) cty.Type { return cty.Object(outTypes) case out.IsSetType(): - var elemType cty.Type - // Sets are compatible with other sets, lists, tuples. if in.IsSetType() || in.IsListType() { - elemType = dynamicReplace(in.ElementType(), out.ElementType()) + return cty.Set(dynamicReplace(in.ElementType(), out.ElementType())) } if in.IsTupleType() { unifiedType, _ := unify(in.TupleElementTypes(), true) - elemType = dynamicReplace(unifiedType, out.ElementType()) + return cty.Set(dynamicReplace(unifiedType, out.ElementType())) } - return cty.Set(elemType) + return out case out.IsListType(): - var elemType cty.Type - // Lists are compatible with other lists, sets, and tuples. if in.IsSetType() || in.IsListType() { - elemType = dynamicReplace(in.ElementType(), out.ElementType()) + return cty.List(dynamicReplace(in.ElementType(), out.ElementType())) } if in.IsTupleType() { unifiedType, _ := unify(in.TupleElementTypes(), true) - elemType = dynamicReplace(unifiedType, out.ElementType()) + return cty.List(dynamicReplace(unifiedType, out.ElementType())) } - return cty.List(elemType) + return out case out.IsTupleType(): // Tuples are only compatible with other tuples var types []cty.Type diff --git a/vendor/github.com/zclconf/go-cty/cty/primitive_type.go b/vendor/github.com/zclconf/go-cty/cty/primitive_type.go index 3ce2540bb6b1..2beea652d877 100644 --- a/vendor/github.com/zclconf/go-cty/cty/primitive_type.go +++ b/vendor/github.com/zclconf/go-cty/cty/primitive_type.go @@ -1,6 +1,8 @@ package cty -import "math/big" +import ( + "math/big" +) // primitiveType is the hidden implementation of the various primitive types // that are exposed as variables in this package. @@ -77,6 +79,18 @@ func rawNumberEqual(a, b *big.Float) bool { case a.Sign() != b.Sign(): return false default: + // First check if these are integers, and compare them directly. Floats + // need a more nuanced approach. + aInt, aAcc := a.Int(nil) + bInt, bAcc := b.Int(nil) + if aAcc != bAcc { + // only one is an exact integer value, so they can't be equal + return false + } + if aAcc == big.Exact { + return aInt.Cmp(bInt) == 0 + } + // This format and precision matches that used by cty/json.Marshal, // and thus achieves our definition of "two numbers are equal if // we'd use the same JSON serialization for both of them". diff --git a/vendor/github.com/zclconf/go-cty/cty/unknown_refinement.go b/vendor/github.com/zclconf/go-cty/cty/unknown_refinement.go index d90bcbc367aa..85fb28d632ce 100644 --- a/vendor/github.com/zclconf/go-cty/cty/unknown_refinement.go +++ b/vendor/github.com/zclconf/go-cty/cty/unknown_refinement.go @@ -44,7 +44,17 @@ func (v Value) Refine() *RefinementBuilder { var wip unknownValRefinement switch { case ty == DynamicPseudoType && !v.IsKnown(): - panic("cannot refine an unknown value of an unknown type") + // This case specifically matches DynamicVal, which is constrained + // by backward compatibility to be a singleton and so we cannot allow + // any refinements to it. + // To preserve the typical assumption that DynamicVal is a safe + // placeholder to use when no value is known at all, we silently + // ignore all attempts to refine this particular value and just + // always echo back a totally-unrefined DynamicVal. + return &RefinementBuilder{ + orig: DynamicVal, + marks: marks, + } case ty == String: wip = &refinementString{} case ty == Number: @@ -136,10 +146,27 @@ type RefinementBuilder struct { wip unknownValRefinement } -func (b *RefinementBuilder) assertRefineable() { +// refineable is an internal detail to help with two special situations +// related to refinements: +// - If the refinement is to a value of a type that doesn't support any +// refinements at all, this function will immediately panic with a +// message reporting that, because it's a caller bug to try to refine +// a value in a way that's inappropriate for its known type. +// - If the refinement is to an unknown value of an unknown type +// (i.e. cty.DynamicVal) then it returns false, indicating that the +// caller should just silently ignore whatever refinement was requested. +// - In all other cases this function returns true, which means the direct +// caller should attempt to apply the requested refinement, and then +// panic itself if the requested refinement doesn't make sense for the +// specific value being refined. +func (b *RefinementBuilder) refineable() bool { + if b.orig == DynamicVal { + return false + } if b.wip == nil { panic(fmt.Sprintf("cannot refine a %#v value", b.orig.Type())) } + return true } // NotNull constrains the value as definitely not being null. @@ -157,7 +184,9 @@ func (b *RefinementBuilder) assertRefineable() { // -- a value whose type is `cty.DynamicPseudoType` -- as being non-null. // An unknown value of an unknown type is always completely unconstrained. func (b *RefinementBuilder) NotNull() *RefinementBuilder { - b.assertRefineable() + if !b.refineable() { + return b + } if b.orig.IsKnown() && b.orig.IsNull() { panic("refining null value as non-null") @@ -181,7 +210,9 @@ func (b *RefinementBuilder) NotNull() *RefinementBuilder { // value for each type constraint -- but this is here for symmetry with the // fact that a [ValueRange] can also represent that a value is definitely null. func (b *RefinementBuilder) Null() *RefinementBuilder { - b.assertRefineable() + if !b.refineable() { + return b + } if b.orig.IsKnown() && !b.orig.IsNull() { panic("refining non-null value as null") @@ -209,7 +240,9 @@ func (b *RefinementBuilder) NumberRangeInclusive(min, max Value) *RefinementBuil // NumberRangeLowerBound constraints the lower bound of a number value, or // panics if this builder is not refining a number value. func (b *RefinementBuilder) NumberRangeLowerBound(min Value, inclusive bool) *RefinementBuilder { - b.assertRefineable() + if !b.refineable() { + return b + } wip, ok := b.wip.(*refinementNumber) if !ok { @@ -258,7 +291,9 @@ func (b *RefinementBuilder) NumberRangeLowerBound(min Value, inclusive bool) *Re // NumberRangeUpperBound constraints the upper bound of a number value, or // panics if this builder is not refining a number value. func (b *RefinementBuilder) NumberRangeUpperBound(max Value, inclusive bool) *RefinementBuilder { - b.assertRefineable() + if !b.refineable() { + return b + } wip, ok := b.wip.(*refinementNumber) if !ok { @@ -308,7 +343,9 @@ func (b *RefinementBuilder) NumberRangeUpperBound(max Value, inclusive bool) *Re // collection value, or panics if this builder is not refining a collection // value. func (b *RefinementBuilder) CollectionLengthLowerBound(min int) *RefinementBuilder { - b.assertRefineable() + if !b.refineable() { + return b + } wip, ok := b.wip.(*refinementCollection) if !ok { @@ -340,7 +377,9 @@ func (b *RefinementBuilder) CollectionLengthLowerBound(min int) *RefinementBuild // The upper bound must be a known, non-null number or this function will // panic. func (b *RefinementBuilder) CollectionLengthUpperBound(max int) *RefinementBuilder { - b.assertRefineable() + if !b.refineable() { + return b + } wip, ok := b.wip.(*refinementCollection) if !ok { @@ -419,7 +458,9 @@ func (b *RefinementBuilder) StringPrefix(prefix string) *RefinementBuilder { // Use [RefinementBuilder.StringPrefix] instead if an application cannot fully // control the final result to avoid violating this rule. func (b *RefinementBuilder) StringPrefixFull(prefix string) *RefinementBuilder { - b.assertRefineable() + if !b.refineable() { + return b + } wip, ok := b.wip.(*refinementString) if !ok { @@ -487,7 +528,7 @@ func (b *RefinementBuilder) NewValue() (ret Value) { ret = ret.WithMarks(b.marks) }() - if b.orig.IsKnown() { + if b.orig.IsKnown() || b.orig == DynamicVal { return b.orig } diff --git a/vendor/github.com/zclconf/go-cty/cty/value_range.go b/vendor/github.com/zclconf/go-cty/cty/value_range.go index 36f21946e379..d7d153539365 100644 --- a/vendor/github.com/zclconf/go-cty/cty/value_range.go +++ b/vendor/github.com/zclconf/go-cty/cty/value_range.go @@ -21,6 +21,10 @@ import ( // offered by ranges and so can share code between both known and unknown // values. func (v Value) Range() ValueRange { + if v.IsMarked() { + panic("Value.Range on marked value; must be unmarked first") + } + // For an unknown value we just use its own refinements. if unk, isUnk := v.v.(*unknownType); isUnk { refinement := unk.refinement diff --git a/vendor/golang.org/x/mod/modfile/rule.go b/vendor/golang.org/x/mod/modfile/rule.go index 930b6c59bc96..26acaa5f7c41 100644 --- a/vendor/golang.org/x/mod/modfile/rule.go +++ b/vendor/golang.org/x/mod/modfile/rule.go @@ -308,6 +308,7 @@ var laxGoVersionRE = lazyregexp.New(`^v?(([1-9][0-9]*)\.(0|[1-9][0-9]*))([^0-9]. // Toolchains must be named beginning with `go1`, // like "go1.20.3" or "go1.20.3-gccgo". As a special case, "default" is also permitted. +// TODO(samthanawalla): Replace regex with https://pkg.go.dev/go/version#IsValid in 1.23+ var ToolchainRE = lazyregexp.New(`^default$|^go1($|\.)`) func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, args []string, fix VersionFixer, strict bool) { @@ -367,7 +368,7 @@ func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, a } } if !fixed { - errorf("invalid go version '%s': must match format 1.23", args[0]) + errorf("invalid go version '%s': must match format 1.23.0", args[0]) return } } @@ -384,7 +385,7 @@ func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, a errorf("toolchain directive expects exactly one argument") return } else if strict && !ToolchainRE.MatchString(args[0]) { - errorf("invalid toolchain version '%s': must match format go1.23 or local", args[0]) + errorf("invalid toolchain version '%s': must match format go1.23.0 or default", args[0]) return } f.Toolchain = &Toolchain{Syntax: line} @@ -542,7 +543,7 @@ func parseReplace(filename string, line *Line, verb string, args []string, fix V if strings.Contains(ns, "@") { return nil, errorf("replacement module must match format 'path version', not 'path@version'") } - return nil, errorf("replacement module without version must be directory path (rooted or starting with ./ or ../)") + return nil, errorf("replacement module without version must be directory path (rooted or starting with . or ..)") } if filepath.Separator == '/' && strings.Contains(ns, `\`) { return nil, errorf("replacement directory appears to be Windows path (on a non-windows system)") @@ -555,7 +556,6 @@ func parseReplace(filename string, line *Line, verb string, args []string, fix V } if IsDirectoryPath(ns) { return nil, errorf("replacement module directory path %q cannot have version", ns) - } } return &Replace{ @@ -631,7 +631,7 @@ func (f *WorkFile) add(errs *ErrorList, line *Line, verb string, args []string, errorf("go directive expects exactly one argument") return } else if !GoVersionRE.MatchString(args[0]) { - errorf("invalid go version '%s': must match format 1.23", args[0]) + errorf("invalid go version '%s': must match format 1.23.0", args[0]) return } @@ -647,7 +647,7 @@ func (f *WorkFile) add(errs *ErrorList, line *Line, verb string, args []string, errorf("toolchain directive expects exactly one argument") return } else if !ToolchainRE.MatchString(args[0]) { - errorf("invalid toolchain version '%s': must match format go1.23 or local", args[0]) + errorf("invalid toolchain version '%s': must match format go1.23.0 or default", args[0]) return } @@ -679,14 +679,15 @@ func (f *WorkFile) add(errs *ErrorList, line *Line, verb string, args []string, } } -// IsDirectoryPath reports whether the given path should be interpreted -// as a directory path. Just like on the go command line, relative paths +// IsDirectoryPath reports whether the given path should be interpreted as a directory path. +// Just like on the go command line, relative paths starting with a '.' or '..' path component // and rooted paths are directory paths; the rest are module paths. func IsDirectoryPath(ns string) bool { // Because go.mod files can move from one system to another, // we check all known path syntaxes, both Unix and Windows. - return strings.HasPrefix(ns, "./") || strings.HasPrefix(ns, "../") || strings.HasPrefix(ns, "/") || - strings.HasPrefix(ns, `.\`) || strings.HasPrefix(ns, `..\`) || strings.HasPrefix(ns, `\`) || + return ns == "." || strings.HasPrefix(ns, "./") || strings.HasPrefix(ns, `.\`) || + ns == ".." || strings.HasPrefix(ns, "../") || strings.HasPrefix(ns, `..\`) || + strings.HasPrefix(ns, "/") || strings.HasPrefix(ns, `\`) || len(ns) >= 2 && ('A' <= ns[0] && ns[0] <= 'Z' || 'a' <= ns[0] && ns[0] <= 'z') && ns[1] == ':' } diff --git a/vendor/golang.org/x/sys/execabs/execabs.go b/vendor/golang.org/x/sys/execabs/execabs.go deleted file mode 100644 index 3bf40fdfecd5..000000000000 --- a/vendor/golang.org/x/sys/execabs/execabs.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package execabs is a drop-in replacement for os/exec -// that requires PATH lookups to find absolute paths. -// That is, execabs.Command("cmd") runs the same PATH lookup -// as exec.Command("cmd"), but if the result is a path -// which is relative, the Run and Start methods will report -// an error instead of running the executable. -// -// See https://blog.golang.org/path-security for more information -// about when it may be necessary or appropriate to use this package. -package execabs - -import ( - "context" - "fmt" - "os/exec" - "path/filepath" - "reflect" - "unsafe" -) - -// ErrNotFound is the error resulting if a path search failed to find an executable file. -// It is an alias for exec.ErrNotFound. -var ErrNotFound = exec.ErrNotFound - -// Cmd represents an external command being prepared or run. -// It is an alias for exec.Cmd. -type Cmd = exec.Cmd - -// Error is returned by LookPath when it fails to classify a file as an executable. -// It is an alias for exec.Error. -type Error = exec.Error - -// An ExitError reports an unsuccessful exit by a command. -// It is an alias for exec.ExitError. -type ExitError = exec.ExitError - -func relError(file, path string) error { - return fmt.Errorf("%s resolves to executable in current directory (.%c%s)", file, filepath.Separator, path) -} - -// LookPath searches for an executable named file in the directories -// named by the PATH environment variable. If file contains a slash, -// it is tried directly and the PATH is not consulted. The result will be -// an absolute path. -// -// LookPath differs from exec.LookPath in its handling of PATH lookups, -// which are used for file names without slashes. If exec.LookPath's -// PATH lookup would have returned an executable from the current directory, -// LookPath instead returns an error. -func LookPath(file string) (string, error) { - path, err := exec.LookPath(file) - if err != nil && !isGo119ErrDot(err) { - return "", err - } - if filepath.Base(file) == file && !filepath.IsAbs(path) { - return "", relError(file, path) - } - return path, nil -} - -func fixCmd(name string, cmd *exec.Cmd) { - if filepath.Base(name) == name && !filepath.IsAbs(cmd.Path) && !isGo119ErrFieldSet(cmd) { - // exec.Command was called with a bare binary name and - // exec.LookPath returned a path which is not absolute. - // Set cmd.lookPathErr and clear cmd.Path so that it - // cannot be run. - lookPathErr := (*error)(unsafe.Pointer(reflect.ValueOf(cmd).Elem().FieldByName("lookPathErr").Addr().Pointer())) - if *lookPathErr == nil { - *lookPathErr = relError(name, cmd.Path) - } - cmd.Path = "" - } -} - -// CommandContext is like Command but includes a context. -// -// The provided context is used to kill the process (by calling os.Process.Kill) -// if the context becomes done before the command completes on its own. -func CommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd { - cmd := exec.CommandContext(ctx, name, arg...) - fixCmd(name, cmd) - return cmd - -} - -// Command returns the Cmd struct to execute the named program with the given arguments. -// See exec.Command for most details. -// -// Command differs from exec.Command in its handling of PATH lookups, -// which are used when the program name contains no slashes. -// If exec.Command would have returned an exec.Cmd configured to run an -// executable from the current directory, Command instead -// returns an exec.Cmd that will return an error from Start or Run. -func Command(name string, arg ...string) *exec.Cmd { - cmd := exec.Command(name, arg...) - fixCmd(name, cmd) - return cmd -} diff --git a/vendor/golang.org/x/sys/execabs/execabs_go118.go b/vendor/golang.org/x/sys/execabs/execabs_go118.go deleted file mode 100644 index 5627d70e3985..000000000000 --- a/vendor/golang.org/x/sys/execabs/execabs_go118.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.19 - -package execabs - -import "os/exec" - -func isGo119ErrDot(err error) bool { - return false -} - -func isGo119ErrFieldSet(cmd *exec.Cmd) bool { - return false -} diff --git a/vendor/golang.org/x/sys/execabs/execabs_go119.go b/vendor/golang.org/x/sys/execabs/execabs_go119.go deleted file mode 100644 index d60ab1b41951..000000000000 --- a/vendor/golang.org/x/sys/execabs/execabs_go119.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.19 - -package execabs - -import ( - "errors" - "os/exec" -) - -func isGo119ErrDot(err error) bool { - return errors.Is(err, exec.ErrDot) -} - -func isGo119ErrFieldSet(cmd *exec.Cmd) bool { - return cmd.Err != nil -} diff --git a/vendor/golang.org/x/tools/cmd/stringer/stringer.go b/vendor/golang.org/x/tools/cmd/stringer/stringer.go new file mode 100644 index 000000000000..2b19c93e8ea8 --- /dev/null +++ b/vendor/golang.org/x/tools/cmd/stringer/stringer.go @@ -0,0 +1,660 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Stringer is a tool to automate the creation of methods that satisfy the fmt.Stringer +// interface. Given the name of a (signed or unsigned) integer type T that has constants +// defined, stringer will create a new self-contained Go source file implementing +// +// func (t T) String() string +// +// The file is created in the same package and directory as the package that defines T. +// It has helpful defaults designed for use with go generate. +// +// Stringer works best with constants that are consecutive values such as created using iota, +// but creates good code regardless. In the future it might also provide custom support for +// constant sets that are bit patterns. +// +// For example, given this snippet, +// +// package painkiller +// +// type Pill int +// +// const ( +// Placebo Pill = iota +// Aspirin +// Ibuprofen +// Paracetamol +// Acetaminophen = Paracetamol +// ) +// +// running this command +// +// stringer -type=Pill +// +// in the same directory will create the file pill_string.go, in package painkiller, +// containing a definition of +// +// func (Pill) String() string +// +// That method will translate the value of a Pill constant to the string representation +// of the respective constant name, so that the call fmt.Print(painkiller.Aspirin) will +// print the string "Aspirin". +// +// Typically this process would be run using go generate, like this: +// +// //go:generate stringer -type=Pill +// +// If multiple constants have the same value, the lexically first matching name will +// be used (in the example, Acetaminophen will print as "Paracetamol"). +// +// With no arguments, it processes the package in the current directory. +// Otherwise, the arguments must name a single directory holding a Go package +// or a set of Go source files that represent a single Go package. +// +// The -type flag accepts a comma-separated list of types so a single run can +// generate methods for multiple types. The default output file is t_string.go, +// where t is the lower-cased name of the first type listed. It can be overridden +// with the -output flag. +// +// The -linecomment flag tells stringer to generate the text of any line comment, trimmed +// of leading spaces, instead of the constant name. For instance, if the constants above had a +// Pill prefix, one could write +// +// PillAspirin // Aspirin +// +// to suppress it in the output. +package main // import "golang.org/x/tools/cmd/stringer" + +import ( + "bytes" + "flag" + "fmt" + "go/ast" + "go/constant" + "go/format" + "go/token" + "go/types" + "log" + "os" + "path/filepath" + "sort" + "strings" + + "golang.org/x/tools/go/packages" +) + +var ( + typeNames = flag.String("type", "", "comma-separated list of type names; must be set") + output = flag.String("output", "", "output file name; default srcdir/_string.go") + trimprefix = flag.String("trimprefix", "", "trim the `prefix` from the generated constant names") + linecomment = flag.Bool("linecomment", false, "use line comment text as printed text when present") + buildTags = flag.String("tags", "", "comma-separated list of build tags to apply") +) + +// Usage is a replacement usage function for the flags package. +func Usage() { + fmt.Fprintf(os.Stderr, "Usage of stringer:\n") + fmt.Fprintf(os.Stderr, "\tstringer [flags] -type T [directory]\n") + fmt.Fprintf(os.Stderr, "\tstringer [flags] -type T files... # Must be a single package\n") + fmt.Fprintf(os.Stderr, "For more information, see:\n") + fmt.Fprintf(os.Stderr, "\thttps://pkg.go.dev/golang.org/x/tools/cmd/stringer\n") + fmt.Fprintf(os.Stderr, "Flags:\n") + flag.PrintDefaults() +} + +func main() { + log.SetFlags(0) + log.SetPrefix("stringer: ") + flag.Usage = Usage + flag.Parse() + if len(*typeNames) == 0 { + flag.Usage() + os.Exit(2) + } + types := strings.Split(*typeNames, ",") + var tags []string + if len(*buildTags) > 0 { + tags = strings.Split(*buildTags, ",") + } + + // We accept either one directory or a list of files. Which do we have? + args := flag.Args() + if len(args) == 0 { + // Default: process whole package in current directory. + args = []string{"."} + } + + // Parse the package once. + var dir string + g := Generator{ + trimPrefix: *trimprefix, + lineComment: *linecomment, + } + // TODO(suzmue): accept other patterns for packages (directories, list of files, import paths, etc). + if len(args) == 1 && isDirectory(args[0]) { + dir = args[0] + } else { + if len(tags) != 0 { + log.Fatal("-tags option applies only to directories, not when files are specified") + } + dir = filepath.Dir(args[0]) + } + + g.parsePackage(args, tags) + + // Print the header and package clause. + g.Printf("// Code generated by \"stringer %s\"; DO NOT EDIT.\n", strings.Join(os.Args[1:], " ")) + g.Printf("\n") + g.Printf("package %s", g.pkg.name) + g.Printf("\n") + g.Printf("import \"strconv\"\n") // Used by all methods. + + // Run generate for each type. + for _, typeName := range types { + g.generate(typeName) + } + + // Format the output. + src := g.format() + + // Write to file. + outputName := *output + if outputName == "" { + baseName := fmt.Sprintf("%s_string.go", types[0]) + outputName = filepath.Join(dir, strings.ToLower(baseName)) + } + err := os.WriteFile(outputName, src, 0644) + if err != nil { + log.Fatalf("writing output: %s", err) + } +} + +// isDirectory reports whether the named file is a directory. +func isDirectory(name string) bool { + info, err := os.Stat(name) + if err != nil { + log.Fatal(err) + } + return info.IsDir() +} + +// Generator holds the state of the analysis. Primarily used to buffer +// the output for format.Source. +type Generator struct { + buf bytes.Buffer // Accumulated output. + pkg *Package // Package we are scanning. + + trimPrefix string + lineComment bool + + logf func(format string, args ...interface{}) // test logging hook; nil when not testing +} + +func (g *Generator) Printf(format string, args ...interface{}) { + fmt.Fprintf(&g.buf, format, args...) +} + +// File holds a single parsed file and associated data. +type File struct { + pkg *Package // Package to which this file belongs. + file *ast.File // Parsed AST. + // These fields are reset for each type being generated. + typeName string // Name of the constant type. + values []Value // Accumulator for constant values of that type. + + trimPrefix string + lineComment bool +} + +type Package struct { + name string + defs map[*ast.Ident]types.Object + files []*File +} + +// parsePackage analyzes the single package constructed from the patterns and tags. +// parsePackage exits if there is an error. +func (g *Generator) parsePackage(patterns []string, tags []string) { + cfg := &packages.Config{ + Mode: packages.NeedName | packages.NeedTypes | packages.NeedTypesInfo | packages.NeedSyntax, + // TODO: Need to think about constants in test files. Maybe write type_string_test.go + // in a separate pass? For later. + Tests: false, + BuildFlags: []string{fmt.Sprintf("-tags=%s", strings.Join(tags, " "))}, + Logf: g.logf, + } + pkgs, err := packages.Load(cfg, patterns...) + if err != nil { + log.Fatal(err) + } + if len(pkgs) != 1 { + log.Fatalf("error: %d packages matching %v", len(pkgs), strings.Join(patterns, " ")) + } + g.addPackage(pkgs[0]) +} + +// addPackage adds a type checked Package and its syntax files to the generator. +func (g *Generator) addPackage(pkg *packages.Package) { + g.pkg = &Package{ + name: pkg.Name, + defs: pkg.TypesInfo.Defs, + files: make([]*File, len(pkg.Syntax)), + } + + for i, file := range pkg.Syntax { + g.pkg.files[i] = &File{ + file: file, + pkg: g.pkg, + trimPrefix: g.trimPrefix, + lineComment: g.lineComment, + } + } +} + +// generate produces the String method for the named type. +func (g *Generator) generate(typeName string) { + values := make([]Value, 0, 100) + for _, file := range g.pkg.files { + // Set the state for this run of the walker. + file.typeName = typeName + file.values = nil + if file.file != nil { + ast.Inspect(file.file, file.genDecl) + values = append(values, file.values...) + } + } + + if len(values) == 0 { + log.Fatalf("no values defined for type %s", typeName) + } + // Generate code that will fail if the constants change value. + g.Printf("func _() {\n") + g.Printf("\t// An \"invalid array index\" compiler error signifies that the constant values have changed.\n") + g.Printf("\t// Re-run the stringer command to generate them again.\n") + g.Printf("\tvar x [1]struct{}\n") + for _, v := range values { + g.Printf("\t_ = x[%s - %s]\n", v.originalName, v.str) + } + g.Printf("}\n") + runs := splitIntoRuns(values) + // The decision of which pattern to use depends on the number of + // runs in the numbers. If there's only one, it's easy. For more than + // one, there's a tradeoff between complexity and size of the data + // and code vs. the simplicity of a map. A map takes more space, + // but so does the code. The decision here (crossover at 10) is + // arbitrary, but considers that for large numbers of runs the cost + // of the linear scan in the switch might become important, and + // rather than use yet another algorithm such as binary search, + // we punt and use a map. In any case, the likelihood of a map + // being necessary for any realistic example other than bitmasks + // is very low. And bitmasks probably deserve their own analysis, + // to be done some other day. + switch { + case len(runs) == 1: + g.buildOneRun(runs, typeName) + case len(runs) <= 10: + g.buildMultipleRuns(runs, typeName) + default: + g.buildMap(runs, typeName) + } +} + +// splitIntoRuns breaks the values into runs of contiguous sequences. +// For example, given 1,2,3,5,6,7 it returns {1,2,3},{5,6,7}. +// The input slice is known to be non-empty. +func splitIntoRuns(values []Value) [][]Value { + // We use stable sort so the lexically first name is chosen for equal elements. + sort.Stable(byValue(values)) + // Remove duplicates. Stable sort has put the one we want to print first, + // so use that one. The String method won't care about which named constant + // was the argument, so the first name for the given value is the only one to keep. + // We need to do this because identical values would cause the switch or map + // to fail to compile. + j := 1 + for i := 1; i < len(values); i++ { + if values[i].value != values[i-1].value { + values[j] = values[i] + j++ + } + } + values = values[:j] + runs := make([][]Value, 0, 10) + for len(values) > 0 { + // One contiguous sequence per outer loop. + i := 1 + for i < len(values) && values[i].value == values[i-1].value+1 { + i++ + } + runs = append(runs, values[:i]) + values = values[i:] + } + return runs +} + +// format returns the gofmt-ed contents of the Generator's buffer. +func (g *Generator) format() []byte { + src, err := format.Source(g.buf.Bytes()) + if err != nil { + // Should never happen, but can arise when developing this code. + // The user can compile the output to see the error. + log.Printf("warning: internal error: invalid Go generated: %s", err) + log.Printf("warning: compile the package to analyze the error") + return g.buf.Bytes() + } + return src +} + +// Value represents a declared constant. +type Value struct { + originalName string // The name of the constant. + name string // The name with trimmed prefix. + // The value is stored as a bit pattern alone. The boolean tells us + // whether to interpret it as an int64 or a uint64; the only place + // this matters is when sorting. + // Much of the time the str field is all we need; it is printed + // by Value.String. + value uint64 // Will be converted to int64 when needed. + signed bool // Whether the constant is a signed type. + str string // The string representation given by the "go/constant" package. +} + +func (v *Value) String() string { + return v.str +} + +// byValue lets us sort the constants into increasing order. +// We take care in the Less method to sort in signed or unsigned order, +// as appropriate. +type byValue []Value + +func (b byValue) Len() int { return len(b) } +func (b byValue) Swap(i, j int) { b[i], b[j] = b[j], b[i] } +func (b byValue) Less(i, j int) bool { + if b[i].signed { + return int64(b[i].value) < int64(b[j].value) + } + return b[i].value < b[j].value +} + +// genDecl processes one declaration clause. +func (f *File) genDecl(node ast.Node) bool { + decl, ok := node.(*ast.GenDecl) + if !ok || decl.Tok != token.CONST { + // We only care about const declarations. + return true + } + // The name of the type of the constants we are declaring. + // Can change if this is a multi-element declaration. + typ := "" + // Loop over the elements of the declaration. Each element is a ValueSpec: + // a list of names possibly followed by a type, possibly followed by values. + // If the type and value are both missing, we carry down the type (and value, + // but the "go/types" package takes care of that). + for _, spec := range decl.Specs { + vspec := spec.(*ast.ValueSpec) // Guaranteed to succeed as this is CONST. + if vspec.Type == nil && len(vspec.Values) > 0 { + // "X = 1". With no type but a value. If the constant is untyped, + // skip this vspec and reset the remembered type. + typ = "" + + // If this is a simple type conversion, remember the type. + // We don't mind if this is actually a call; a qualified call won't + // be matched (that will be SelectorExpr, not Ident), and only unusual + // situations will result in a function call that appears to be + // a type conversion. + ce, ok := vspec.Values[0].(*ast.CallExpr) + if !ok { + continue + } + id, ok := ce.Fun.(*ast.Ident) + if !ok { + continue + } + typ = id.Name + } + if vspec.Type != nil { + // "X T". We have a type. Remember it. + ident, ok := vspec.Type.(*ast.Ident) + if !ok { + continue + } + typ = ident.Name + } + if typ != f.typeName { + // This is not the type we're looking for. + continue + } + // We now have a list of names (from one line of source code) all being + // declared with the desired type. + // Grab their names and actual values and store them in f.values. + for _, name := range vspec.Names { + if name.Name == "_" { + continue + } + // This dance lets the type checker find the values for us. It's a + // bit tricky: look up the object declared by the name, find its + // types.Const, and extract its value. + obj, ok := f.pkg.defs[name] + if !ok { + log.Fatalf("no value for constant %s", name) + } + info := obj.Type().Underlying().(*types.Basic).Info() + if info&types.IsInteger == 0 { + log.Fatalf("can't handle non-integer constant type %s", typ) + } + value := obj.(*types.Const).Val() // Guaranteed to succeed as this is CONST. + if value.Kind() != constant.Int { + log.Fatalf("can't happen: constant is not an integer %s", name) + } + i64, isInt := constant.Int64Val(value) + u64, isUint := constant.Uint64Val(value) + if !isInt && !isUint { + log.Fatalf("internal error: value of %s is not an integer: %s", name, value.String()) + } + if !isInt { + u64 = uint64(i64) + } + v := Value{ + originalName: name.Name, + value: u64, + signed: info&types.IsUnsigned == 0, + str: value.String(), + } + if c := vspec.Comment; f.lineComment && c != nil && len(c.List) == 1 { + v.name = strings.TrimSpace(c.Text()) + } else { + v.name = strings.TrimPrefix(v.originalName, f.trimPrefix) + } + f.values = append(f.values, v) + } + } + return false +} + +// Helpers + +// usize returns the number of bits of the smallest unsigned integer +// type that will hold n. Used to create the smallest possible slice of +// integers to use as indexes into the concatenated strings. +func usize(n int) int { + switch { + case n < 1<<8: + return 8 + case n < 1<<16: + return 16 + default: + // 2^32 is enough constants for anyone. + return 32 + } +} + +// declareIndexAndNameVars declares the index slices and concatenated names +// strings representing the runs of values. +func (g *Generator) declareIndexAndNameVars(runs [][]Value, typeName string) { + var indexes, names []string + for i, run := range runs { + index, name := g.createIndexAndNameDecl(run, typeName, fmt.Sprintf("_%d", i)) + if len(run) != 1 { + indexes = append(indexes, index) + } + names = append(names, name) + } + g.Printf("const (\n") + for _, name := range names { + g.Printf("\t%s\n", name) + } + g.Printf(")\n\n") + + if len(indexes) > 0 { + g.Printf("var (") + for _, index := range indexes { + g.Printf("\t%s\n", index) + } + g.Printf(")\n\n") + } +} + +// declareIndexAndNameVar is the single-run version of declareIndexAndNameVars +func (g *Generator) declareIndexAndNameVar(run []Value, typeName string) { + index, name := g.createIndexAndNameDecl(run, typeName, "") + g.Printf("const %s\n", name) + g.Printf("var %s\n", index) +} + +// createIndexAndNameDecl returns the pair of declarations for the run. The caller will add "const" and "var". +func (g *Generator) createIndexAndNameDecl(run []Value, typeName string, suffix string) (string, string) { + b := new(bytes.Buffer) + indexes := make([]int, len(run)) + for i := range run { + b.WriteString(run[i].name) + indexes[i] = b.Len() + } + nameConst := fmt.Sprintf("_%s_name%s = %q", typeName, suffix, b.String()) + nameLen := b.Len() + b.Reset() + fmt.Fprintf(b, "_%s_index%s = [...]uint%d{0, ", typeName, suffix, usize(nameLen)) + for i, v := range indexes { + if i > 0 { + fmt.Fprintf(b, ", ") + } + fmt.Fprintf(b, "%d", v) + } + fmt.Fprintf(b, "}") + return b.String(), nameConst +} + +// declareNameVars declares the concatenated names string representing all the values in the runs. +func (g *Generator) declareNameVars(runs [][]Value, typeName string, suffix string) { + g.Printf("const _%s_name%s = \"", typeName, suffix) + for _, run := range runs { + for i := range run { + g.Printf("%s", run[i].name) + } + } + g.Printf("\"\n") +} + +// buildOneRun generates the variables and String method for a single run of contiguous values. +func (g *Generator) buildOneRun(runs [][]Value, typeName string) { + values := runs[0] + g.Printf("\n") + g.declareIndexAndNameVar(values, typeName) + // The generated code is simple enough to write as a Printf format. + lessThanZero := "" + if values[0].signed { + lessThanZero = "i < 0 || " + } + if values[0].value == 0 { // Signed or unsigned, 0 is still 0. + g.Printf(stringOneRun, typeName, usize(len(values)), lessThanZero) + } else { + g.Printf(stringOneRunWithOffset, typeName, values[0].String(), usize(len(values)), lessThanZero) + } +} + +// Arguments to format are: +// +// [1]: type name +// [2]: size of index element (8 for uint8 etc.) +// [3]: less than zero check (for signed types) +const stringOneRun = `func (i %[1]s) String() string { + if %[3]si >= %[1]s(len(_%[1]s_index)-1) { + return "%[1]s(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _%[1]s_name[_%[1]s_index[i]:_%[1]s_index[i+1]] +} +` + +// Arguments to format are: +// [1]: type name +// [2]: lowest defined value for type, as a string +// [3]: size of index element (8 for uint8 etc.) +// [4]: less than zero check (for signed types) +/* + */ +const stringOneRunWithOffset = `func (i %[1]s) String() string { + i -= %[2]s + if %[4]si >= %[1]s(len(_%[1]s_index)-1) { + return "%[1]s(" + strconv.FormatInt(int64(i + %[2]s), 10) + ")" + } + return _%[1]s_name[_%[1]s_index[i] : _%[1]s_index[i+1]] +} +` + +// buildMultipleRuns generates the variables and String method for multiple runs of contiguous values. +// For this pattern, a single Printf format won't do. +func (g *Generator) buildMultipleRuns(runs [][]Value, typeName string) { + g.Printf("\n") + g.declareIndexAndNameVars(runs, typeName) + g.Printf("func (i %s) String() string {\n", typeName) + g.Printf("\tswitch {\n") + for i, values := range runs { + if len(values) == 1 { + g.Printf("\tcase i == %s:\n", &values[0]) + g.Printf("\t\treturn _%s_name_%d\n", typeName, i) + continue + } + if values[0].value == 0 && !values[0].signed { + // For an unsigned lower bound of 0, "0 <= i" would be redundant. + g.Printf("\tcase i <= %s:\n", &values[len(values)-1]) + } else { + g.Printf("\tcase %s <= i && i <= %s:\n", &values[0], &values[len(values)-1]) + } + if values[0].value != 0 { + g.Printf("\t\ti -= %s\n", &values[0]) + } + g.Printf("\t\treturn _%s_name_%d[_%s_index_%d[i]:_%s_index_%d[i+1]]\n", + typeName, i, typeName, i, typeName, i) + } + g.Printf("\tdefault:\n") + g.Printf("\t\treturn \"%s(\" + strconv.FormatInt(int64(i), 10) + \")\"\n", typeName) + g.Printf("\t}\n") + g.Printf("}\n") +} + +// buildMap handles the case where the space is so sparse a map is a reasonable fallback. +// It's a rare situation but has simple code. +func (g *Generator) buildMap(runs [][]Value, typeName string) { + g.Printf("\n") + g.declareNameVars(runs, typeName, "") + g.Printf("\nvar _%s_map = map[%s]string{\n", typeName, typeName) + n := 0 + for _, values := range runs { + for _, value := range values { + g.Printf("\t%s: _%s_name[%d:%d],\n", &value, typeName, n, n+len(value.name)) + n += len(value.name) + } + } + g.Printf("}\n\n") + g.Printf(stringMap, typeName) +} + +// Argument to format is the type name. +const stringMap = `func (i %[1]s) String() string { + if str, ok := _%[1]s_map[i]; ok { + return str + } + return "%[1]s(" + strconv.FormatInt(int64(i), 10) + ")" +} +` diff --git a/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go b/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go index 9fa5aa192c29..2c4c4e232890 100644 --- a/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go +++ b/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go @@ -11,8 +11,6 @@ import ( "go/ast" "go/token" "sort" - - "golang.org/x/tools/internal/typeparams" ) // PathEnclosingInterval returns the node that encloses the source @@ -322,7 +320,7 @@ func childrenOf(n ast.Node) []ast.Node { children = append(children, n.Recv) } children = append(children, n.Name) - if tparams := typeparams.ForFuncType(n.Type); tparams != nil { + if tparams := n.Type.TypeParams; tparams != nil { children = append(children, tparams) } if n.Type.Params != nil { @@ -377,7 +375,7 @@ func childrenOf(n ast.Node) []ast.Node { tok(n.Lbrack, len("[")), tok(n.Rbrack, len("]"))) - case *typeparams.IndexListExpr: + case *ast.IndexListExpr: children = append(children, tok(n.Lbrack, len("[")), tok(n.Rbrack, len("]"))) @@ -588,7 +586,7 @@ func NodeDescription(n ast.Node) string { return "decrement statement" case *ast.IndexExpr: return "index expression" - case *typeparams.IndexListExpr: + case *ast.IndexListExpr: return "index list expression" case *ast.InterfaceType: return "interface type" diff --git a/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go b/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go index f430b21b9b9a..58934f76633d 100644 --- a/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go +++ b/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go @@ -9,8 +9,6 @@ import ( "go/ast" "reflect" "sort" - - "golang.org/x/tools/internal/typeparams" ) // An ApplyFunc is invoked by Apply for each node n, even if n is nil, @@ -252,7 +250,7 @@ func (a *application) apply(parent ast.Node, name string, iter *iterator, n ast. a.apply(n, "X", nil, n.X) a.apply(n, "Index", nil, n.Index) - case *typeparams.IndexListExpr: + case *ast.IndexListExpr: a.apply(n, "X", nil, n.X) a.applyList(n, "Indices") @@ -293,7 +291,7 @@ func (a *application) apply(parent ast.Node, name string, iter *iterator, n ast. a.apply(n, "Fields", nil, n.Fields) case *ast.FuncType: - if tparams := typeparams.ForFuncType(n); tparams != nil { + if tparams := n.TypeParams; tparams != nil { a.apply(n, "TypeParams", nil, tparams) } a.apply(n, "Params", nil, n.Params) @@ -408,7 +406,7 @@ func (a *application) apply(parent ast.Node, name string, iter *iterator, n ast. case *ast.TypeSpec: a.apply(n, "Doc", nil, n.Doc) a.apply(n, "Name", nil, n.Name) - if tparams := typeparams.ForTypeSpec(n); tparams != nil { + if tparams := n.TypeParams; tparams != nil { a.apply(n, "TypeParams", nil, tparams) } a.apply(n, "Type", nil, n.Type) diff --git a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go index 03543bd4bb8f..137cc8df1d86 100644 --- a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go +++ b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go @@ -47,7 +47,7 @@ import ( func Find(importPath, srcDir string) (filename, path string) { cmd := exec.Command("go", "list", "-json", "-export", "--", importPath) cmd.Dir = srcDir - out, err := cmd.CombinedOutput() + out, err := cmd.Output() if err != nil { return "", "" } diff --git a/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go b/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go index 0454cdd78e55..333676b7cfcc 100644 --- a/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go +++ b/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go @@ -13,16 +13,17 @@ import ( "golang.org/x/tools/internal/gocommand" ) -var debug = false - func GetSizesForArgsGolist(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (string, string, error) { inv.Verb = "list" inv.Args = []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"} stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv) var goarch, compiler string if rawErr != nil { - if rawErrMsg := rawErr.Error(); strings.Contains(rawErrMsg, "cannot find main module") || strings.Contains(rawErrMsg, "go.mod file not found") { - // User's running outside of a module. All bets are off. Get GOARCH and guess compiler is gc. + rawErrMsg := rawErr.Error() + if strings.Contains(rawErrMsg, "cannot find main module") || + strings.Contains(rawErrMsg, "go.mod file not found") { + // User's running outside of a module. + // All bets are off. Get GOARCH and guess compiler is gc. // TODO(matloob): Is this a problem in practice? inv.Verb = "env" inv.Args = []string{"GOARCH"} @@ -32,8 +33,12 @@ func GetSizesForArgsGolist(ctx context.Context, inv gocommand.Invocation, gocmdR } goarch = strings.TrimSpace(envout.String()) compiler = "gc" - } else { + } else if friendlyErr != nil { return "", "", friendlyErr + } else { + // This should be unreachable, but be defensive + // in case RunRaw's error results are inconsistent. + return "", "", rawErr } } else { fields := strings.Fields(stdout.String()) diff --git a/vendor/golang.org/x/tools/go/packages/doc.go b/vendor/golang.org/x/tools/go/packages/doc.go index da4ab89fe63f..a8d7b06ac090 100644 --- a/vendor/golang.org/x/tools/go/packages/doc.go +++ b/vendor/golang.org/x/tools/go/packages/doc.go @@ -5,12 +5,20 @@ /* Package packages loads Go packages for inspection and analysis. -The Load function takes as input a list of patterns and return a list of Package -structs describing individual packages matched by those patterns. -The LoadMode controls the amount of detail in the loaded packages. - -Load passes most patterns directly to the underlying build tool, -but all patterns with the prefix "query=", where query is a +The [Load] function takes as input a list of patterns and returns a +list of [Package] values describing individual packages matched by those +patterns. +A [Config] specifies configuration options, the most important of which is +the [LoadMode], which controls the amount of detail in the loaded packages. + +Load passes most patterns directly to the underlying build tool. +The default build tool is the go command. +Its supported patterns are described at +https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns. +Other build systems may be supported by providing a "driver"; +see [The driver protocol]. + +All patterns with the prefix "query=", where query is a non-empty string of letters from [a-z], are reserved and may be interpreted as query operators. @@ -35,7 +43,7 @@ The Package struct provides basic information about the package, including - Imports, a map from source import strings to the Packages they name; - Types, the type information for the package's exported symbols; - Syntax, the parsed syntax trees for the package's source code; and - - TypeInfo, the result of a complete type-check of the package syntax trees. + - TypesInfo, the result of a complete type-check of the package syntax trees. (See the documentation for type Package for the complete list of fields and more detailed descriptions.) @@ -64,9 +72,31 @@ reported about the loaded packages. See the documentation for type LoadMode for details. Most tools should pass their command-line arguments (after any flags) -uninterpreted to the loader, so that the loader can interpret them +uninterpreted to [Load], so that it can interpret them according to the conventions of the underlying build system. + See the Example function for typical usage. + +# The driver protocol + +[Load] may be used to load Go packages even in Go projects that use +alternative build systems, by installing an appropriate "driver" +program for the build system and specifying its location in the +GOPACKAGESDRIVER environment variable. +For example, +https://github.com/bazelbuild/rules_go/wiki/Editor-and-tool-integration +explains how to use the driver for Bazel. + +The driver program is responsible for interpreting patterns in its +preferred notation and reporting information about the packages that +those patterns identify. Drivers must also support the special "file=" +and "pattern=" patterns described above. + +The patterns are provided as positional command-line arguments. A +JSON-encoded [DriverRequest] message providing additional information +is written to the driver's standard input. The driver must write a +JSON-encoded [DriverResponse] message to its standard output. (This +message differs from the JSON schema produced by 'go list'.) */ package packages // import "golang.org/x/tools/go/packages" diff --git a/vendor/golang.org/x/tools/go/packages/external.go b/vendor/golang.org/x/tools/go/packages/external.go index 7242a0a7d2be..4335c1eb14c7 100644 --- a/vendor/golang.org/x/tools/go/packages/external.go +++ b/vendor/golang.org/x/tools/go/packages/external.go @@ -2,46 +2,85 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// This file enables an external tool to intercept package requests. -// If the tool is present then its results are used in preference to -// the go list command. - package packages +// This file defines the protocol that enables an external "driver" +// tool to supply package metadata in place of 'go list'. + import ( "bytes" "encoding/json" "fmt" - exec "golang.org/x/sys/execabs" "os" + "os/exec" "strings" ) -// The Driver Protocol +// DriverRequest defines the schema of a request for package metadata +// from an external driver program. The JSON-encoded DriverRequest +// message is provided to the driver program's standard input. The +// query patterns are provided as command-line arguments. // -// The driver, given the inputs to a call to Load, returns metadata about the packages specified. -// This allows for different build systems to support go/packages by telling go/packages how the -// packages' source is organized. -// The driver is a binary, either specified by the GOPACKAGESDRIVER environment variable or in -// the path as gopackagesdriver. It's given the inputs to load in its argv. See the package -// documentation in doc.go for the full description of the patterns that need to be supported. -// A driver receives as a JSON-serialized driverRequest struct in standard input and will -// produce a JSON-serialized driverResponse (see definition in packages.go) in its standard output. - -// driverRequest is used to provide the portion of Load's Config that is needed by a driver. -type driverRequest struct { +// See the package documentation for an overview. +type DriverRequest struct { Mode LoadMode `json:"mode"` + // Env specifies the environment the underlying build system should be run in. Env []string `json:"env"` + // BuildFlags are flags that should be passed to the underlying build system. BuildFlags []string `json:"build_flags"` + // Tests specifies whether the patterns should also return test packages. Tests bool `json:"tests"` + // Overlay maps file paths (relative to the driver's working directory) to the byte contents // of overlay files. Overlay map[string][]byte `json:"overlay"` } +// DriverResponse defines the schema of a response from an external +// driver program, providing the results of a query for package +// metadata. The driver program must write a JSON-encoded +// DriverResponse message to its standard output. +// +// See the package documentation for an overview. +type DriverResponse struct { + // NotHandled is returned if the request can't be handled by the current + // driver. If an external driver returns a response with NotHandled, the + // rest of the DriverResponse is ignored, and go/packages will fallback + // to the next driver. If go/packages is extended in the future to support + // lists of multiple drivers, go/packages will fall back to the next driver. + NotHandled bool + + // Compiler and Arch are the arguments pass of types.SizesFor + // to get a types.Sizes to use when type checking. + Compiler string + Arch string + + // Roots is the set of package IDs that make up the root packages. + // We have to encode this separately because when we encode a single package + // we cannot know if it is one of the roots as that requires knowledge of the + // graph it is part of. + Roots []string `json:",omitempty"` + + // Packages is the full set of packages in the graph. + // The packages are not connected into a graph. + // The Imports if populated will be stubs that only have their ID set. + // Imports will be connected and then type and syntax information added in a + // later pass (see refine). + Packages []*Package + + // GoVersion is the minor version number used by the driver + // (e.g. the go command on the PATH) when selecting .go files. + // Zero means unknown. + GoVersion int +} + +// driver is the type for functions that query the build system for the +// packages named by the patterns. +type driver func(cfg *Config, patterns ...string) (*DriverResponse, error) + // findExternalDriver returns the file path of a tool that supplies // the build system package structure, or "" if not found." // If GOPACKAGESDRIVER is set in the environment findExternalTool returns its @@ -64,8 +103,8 @@ func findExternalDriver(cfg *Config) driver { return nil } } - return func(cfg *Config, words ...string) (*driverResponse, error) { - req, err := json.Marshal(driverRequest{ + return func(cfg *Config, words ...string) (*DriverResponse, error) { + req, err := json.Marshal(DriverRequest{ Mode: cfg.Mode, Env: cfg.Env, BuildFlags: cfg.BuildFlags, @@ -92,7 +131,7 @@ func findExternalDriver(cfg *Config) driver { fmt.Fprintf(os.Stderr, "%s stderr: <<%s>>\n", cmdDebugStr(cmd), stderr) } - var response driverResponse + var response DriverResponse if err := json.Unmarshal(buf.Bytes(), &response); err != nil { return nil, err } diff --git a/vendor/golang.org/x/tools/go/packages/golist.go b/vendor/golang.org/x/tools/go/packages/golist.go index b5de9cf9f210..22305d9c90a1 100644 --- a/vendor/golang.org/x/tools/go/packages/golist.go +++ b/vendor/golang.org/x/tools/go/packages/golist.go @@ -9,9 +9,9 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" "log" "os" + "os/exec" "path" "path/filepath" "reflect" @@ -21,7 +21,6 @@ import ( "sync" "unicode" - exec "golang.org/x/sys/execabs" "golang.org/x/tools/go/internal/packagesdriver" "golang.org/x/tools/internal/gocommand" "golang.org/x/tools/internal/packagesinternal" @@ -36,23 +35,23 @@ type goTooOldError struct { error } -// responseDeduper wraps a driverResponse, deduplicating its contents. +// responseDeduper wraps a DriverResponse, deduplicating its contents. type responseDeduper struct { seenRoots map[string]bool seenPackages map[string]*Package - dr *driverResponse + dr *DriverResponse } func newDeduper() *responseDeduper { return &responseDeduper{ - dr: &driverResponse{}, + dr: &DriverResponse{}, seenRoots: map[string]bool{}, seenPackages: map[string]*Package{}, } } -// addAll fills in r with a driverResponse. -func (r *responseDeduper) addAll(dr *driverResponse) { +// addAll fills in r with a DriverResponse. +func (r *responseDeduper) addAll(dr *DriverResponse) { for _, pkg := range dr.Packages { r.addPackage(pkg) } @@ -129,7 +128,7 @@ func (state *golistState) mustGetEnv() map[string]string { // goListDriver uses the go list command to interpret the patterns and produce // the build system package structure. // See driver for more details. -func goListDriver(cfg *Config, patterns ...string) (*driverResponse, error) { +func goListDriver(cfg *Config, patterns ...string) (_ *DriverResponse, err error) { // Make sure that any asynchronous go commands are killed when we return. parentCtx := cfg.Context if parentCtx == nil { @@ -147,16 +146,18 @@ func goListDriver(cfg *Config, patterns ...string) (*driverResponse, error) { } // Fill in response.Sizes asynchronously if necessary. - var sizeserr error - var sizeswg sync.WaitGroup if cfg.Mode&NeedTypesSizes != 0 || cfg.Mode&NeedTypes != 0 { - sizeswg.Add(1) + errCh := make(chan error) go func() { compiler, arch, err := packagesdriver.GetSizesForArgsGolist(ctx, state.cfgInvocation(), cfg.gocmdRunner) - sizeserr = err response.dr.Compiler = compiler response.dr.Arch = arch - sizeswg.Done() + errCh <- err + }() + defer func() { + if sizesErr := <-errCh; sizesErr != nil { + err = sizesErr + } }() } @@ -209,87 +210,10 @@ extractQueries: } } - // Only use go/packages' overlay processing if we're using a Go version - // below 1.16. Otherwise, go list handles it. - if goVersion, err := state.getGoVersion(); err == nil && goVersion < 16 { - modifiedPkgs, needPkgs, err := state.processGolistOverlay(response) - if err != nil { - return nil, err - } - - var containsCandidates []string - if len(containFiles) > 0 { - containsCandidates = append(containsCandidates, modifiedPkgs...) - containsCandidates = append(containsCandidates, needPkgs...) - } - if err := state.addNeededOverlayPackages(response, needPkgs); err != nil { - return nil, err - } - // Check candidate packages for containFiles. - if len(containFiles) > 0 { - for _, id := range containsCandidates { - pkg, ok := response.seenPackages[id] - if !ok { - response.addPackage(&Package{ - ID: id, - Errors: []Error{{ - Kind: ListError, - Msg: fmt.Sprintf("package %s expected but not seen", id), - }}, - }) - continue - } - for _, f := range containFiles { - for _, g := range pkg.GoFiles { - if sameFile(f, g) { - response.addRoot(id) - } - } - } - } - } - // Add root for any package that matches a pattern. This applies only to - // packages that are modified by overlays, since they are not added as - // roots automatically. - for _, pattern := range restPatterns { - match := matchPattern(pattern) - for _, pkgID := range modifiedPkgs { - pkg, ok := response.seenPackages[pkgID] - if !ok { - continue - } - if match(pkg.PkgPath) { - response.addRoot(pkg.ID) - } - } - } - } - - sizeswg.Wait() - if sizeserr != nil { - return nil, sizeserr - } + // (We may yet return an error due to defer.) return response.dr, nil } -func (state *golistState) addNeededOverlayPackages(response *responseDeduper, pkgs []string) error { - if len(pkgs) == 0 { - return nil - } - dr, err := state.createDriverResponse(pkgs...) - if err != nil { - return err - } - for _, pkg := range dr.Packages { - response.addPackage(pkg) - } - _, needPkgs, err := state.processGolistOverlay(response) - if err != nil { - return err - } - return state.addNeededOverlayPackages(response, needPkgs) -} - func (state *golistState) runContainsQueries(response *responseDeduper, queries []string) error { for _, query := range queries { // TODO(matloob): Do only one query per directory. @@ -341,7 +265,7 @@ func (state *golistState) runContainsQueries(response *responseDeduper, queries // adhocPackage attempts to load or construct an ad-hoc package for a given // query, if the original call to the driver produced inadequate results. -func (state *golistState) adhocPackage(pattern, query string) (*driverResponse, error) { +func (state *golistState) adhocPackage(pattern, query string) (*DriverResponse, error) { response, err := state.createDriverResponse(query) if err != nil { return nil, err @@ -432,7 +356,7 @@ func otherFiles(p *jsonPackage) [][]string { // createDriverResponse uses the "go list" command to expand the pattern // words and return a response for the specified packages. -func (state *golistState) createDriverResponse(words ...string) (*driverResponse, error) { +func (state *golistState) createDriverResponse(words ...string) (*DriverResponse, error) { // go list uses the following identifiers in ImportPath and Imports: // // "p" -- importable package or main (command) @@ -459,7 +383,7 @@ func (state *golistState) createDriverResponse(words ...string) (*driverResponse pkgs := make(map[string]*Package) additionalErrors := make(map[string][]Error) // Decode the JSON and convert it to Package form. - response := &driverResponse{ + response := &DriverResponse{ GoVersion: goVersion, } for dec := json.NewDecoder(buf); dec.More(); { @@ -1109,7 +1033,7 @@ func (state *golistState) writeOverlays() (filename string, cleanup func(), err if len(state.cfg.Overlay) == 0 { return "", func() {}, nil } - dir, err := ioutil.TempDir("", "gopackages-*") + dir, err := os.MkdirTemp("", "gopackages-*") if err != nil { return "", nil, err } @@ -1128,7 +1052,7 @@ func (state *golistState) writeOverlays() (filename string, cleanup func(), err // Create a unique filename for the overlaid files, to avoid // creating nested directories. noSeparator := strings.Join(strings.Split(filepath.ToSlash(k), "/"), "") - f, err := ioutil.TempFile(dir, fmt.Sprintf("*-%s", noSeparator)) + f, err := os.CreateTemp(dir, fmt.Sprintf("*-%s", noSeparator)) if err != nil { return "", func() {}, err } @@ -1146,7 +1070,7 @@ func (state *golistState) writeOverlays() (filename string, cleanup func(), err } // Write out the overlay file that contains the filepath mappings. filename = filepath.Join(dir, "overlay.json") - if err := ioutil.WriteFile(filename, b, 0665); err != nil { + if err := os.WriteFile(filename, b, 0665); err != nil { return "", func() {}, err } return filename, cleanup, nil diff --git a/vendor/golang.org/x/tools/go/packages/golist_overlay.go b/vendor/golang.org/x/tools/go/packages/golist_overlay.go index 9576b472f9cc..d823c474ad3a 100644 --- a/vendor/golang.org/x/tools/go/packages/golist_overlay.go +++ b/vendor/golang.org/x/tools/go/packages/golist_overlay.go @@ -6,314 +6,11 @@ package packages import ( "encoding/json" - "fmt" - "go/parser" - "go/token" - "os" "path/filepath" - "regexp" - "sort" - "strconv" - "strings" "golang.org/x/tools/internal/gocommand" ) -// processGolistOverlay provides rudimentary support for adding -// files that don't exist on disk to an overlay. The results can be -// sometimes incorrect. -// TODO(matloob): Handle unsupported cases, including the following: -// - determining the correct package to add given a new import path -func (state *golistState) processGolistOverlay(response *responseDeduper) (modifiedPkgs, needPkgs []string, err error) { - havePkgs := make(map[string]string) // importPath -> non-test package ID - needPkgsSet := make(map[string]bool) - modifiedPkgsSet := make(map[string]bool) - - pkgOfDir := make(map[string][]*Package) - for _, pkg := range response.dr.Packages { - // This is an approximation of import path to id. This can be - // wrong for tests, vendored packages, and a number of other cases. - havePkgs[pkg.PkgPath] = pkg.ID - dir, err := commonDir(pkg.GoFiles) - if err != nil { - return nil, nil, err - } - if dir != "" { - pkgOfDir[dir] = append(pkgOfDir[dir], pkg) - } - } - - // If no new imports are added, it is safe to avoid loading any needPkgs. - // Otherwise, it's hard to tell which package is actually being loaded - // (due to vendoring) and whether any modified package will show up - // in the transitive set of dependencies (because new imports are added, - // potentially modifying the transitive set of dependencies). - var overlayAddsImports bool - - // If both a package and its test package are created by the overlay, we - // need the real package first. Process all non-test files before test - // files, and make the whole process deterministic while we're at it. - var overlayFiles []string - for opath := range state.cfg.Overlay { - overlayFiles = append(overlayFiles, opath) - } - sort.Slice(overlayFiles, func(i, j int) bool { - iTest := strings.HasSuffix(overlayFiles[i], "_test.go") - jTest := strings.HasSuffix(overlayFiles[j], "_test.go") - if iTest != jTest { - return !iTest // non-tests are before tests. - } - return overlayFiles[i] < overlayFiles[j] - }) - for _, opath := range overlayFiles { - contents := state.cfg.Overlay[opath] - base := filepath.Base(opath) - dir := filepath.Dir(opath) - var pkg *Package // if opath belongs to both a package and its test variant, this will be the test variant - var testVariantOf *Package // if opath is a test file, this is the package it is testing - var fileExists bool - isTestFile := strings.HasSuffix(opath, "_test.go") - pkgName, ok := extractPackageName(opath, contents) - if !ok { - // Don't bother adding a file that doesn't even have a parsable package statement - // to the overlay. - continue - } - // If all the overlay files belong to a different package, change the - // package name to that package. - maybeFixPackageName(pkgName, isTestFile, pkgOfDir[dir]) - nextPackage: - for _, p := range response.dr.Packages { - if pkgName != p.Name && p.ID != "command-line-arguments" { - continue - } - for _, f := range p.GoFiles { - if !sameFile(filepath.Dir(f), dir) { - continue - } - // Make sure to capture information on the package's test variant, if needed. - if isTestFile && !hasTestFiles(p) { - // TODO(matloob): Are there packages other than the 'production' variant - // of a package that this can match? This shouldn't match the test main package - // because the file is generated in another directory. - testVariantOf = p - continue nextPackage - } else if !isTestFile && hasTestFiles(p) { - // We're examining a test variant, but the overlaid file is - // a non-test file. Because the overlay implementation - // (currently) only adds a file to one package, skip this - // package, so that we can add the file to the production - // variant of the package. (https://golang.org/issue/36857 - // tracks handling overlays on both the production and test - // variant of a package). - continue nextPackage - } - if pkg != nil && p != pkg && pkg.PkgPath == p.PkgPath { - // We have already seen the production version of the - // for which p is a test variant. - if hasTestFiles(p) { - testVariantOf = pkg - } - } - pkg = p - if filepath.Base(f) == base { - fileExists = true - } - } - } - // The overlay could have included an entirely new package or an - // ad-hoc package. An ad-hoc package is one that we have manually - // constructed from inadequate `go list` results for a file= query. - // It will have the ID command-line-arguments. - if pkg == nil || pkg.ID == "command-line-arguments" { - // Try to find the module or gopath dir the file is contained in. - // Then for modules, add the module opath to the beginning. - pkgPath, ok, err := state.getPkgPath(dir) - if err != nil { - return nil, nil, err - } - if !ok { - break - } - var forTest string // only set for x tests - isXTest := strings.HasSuffix(pkgName, "_test") - if isXTest { - forTest = pkgPath - pkgPath += "_test" - } - id := pkgPath - if isTestFile { - if isXTest { - id = fmt.Sprintf("%s [%s.test]", pkgPath, forTest) - } else { - id = fmt.Sprintf("%s [%s.test]", pkgPath, pkgPath) - } - } - if pkg != nil { - // TODO(rstambler): We should change the package's path and ID - // here. The only issue is that this messes with the roots. - } else { - // Try to reclaim a package with the same ID, if it exists in the response. - for _, p := range response.dr.Packages { - if reclaimPackage(p, id, opath, contents) { - pkg = p - break - } - } - // Otherwise, create a new package. - if pkg == nil { - pkg = &Package{ - PkgPath: pkgPath, - ID: id, - Name: pkgName, - Imports: make(map[string]*Package), - } - response.addPackage(pkg) - havePkgs[pkg.PkgPath] = id - // Add the production package's sources for a test variant. - if isTestFile && !isXTest && testVariantOf != nil { - pkg.GoFiles = append(pkg.GoFiles, testVariantOf.GoFiles...) - pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, testVariantOf.CompiledGoFiles...) - // Add the package under test and its imports to the test variant. - pkg.forTest = testVariantOf.PkgPath - for k, v := range testVariantOf.Imports { - pkg.Imports[k] = &Package{ID: v.ID} - } - } - if isXTest { - pkg.forTest = forTest - } - } - } - } - if !fileExists { - pkg.GoFiles = append(pkg.GoFiles, opath) - // TODO(matloob): Adding the file to CompiledGoFiles can exhibit the wrong behavior - // if the file will be ignored due to its build tags. - pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, opath) - modifiedPkgsSet[pkg.ID] = true - } - imports, err := extractImports(opath, contents) - if err != nil { - // Let the parser or type checker report errors later. - continue - } - for _, imp := range imports { - // TODO(rstambler): If the package is an x test and the import has - // a test variant, make sure to replace it. - if _, found := pkg.Imports[imp]; found { - continue - } - overlayAddsImports = true - id, ok := havePkgs[imp] - if !ok { - var err error - id, err = state.resolveImport(dir, imp) - if err != nil { - return nil, nil, err - } - } - pkg.Imports[imp] = &Package{ID: id} - // Add dependencies to the non-test variant version of this package as well. - if testVariantOf != nil { - testVariantOf.Imports[imp] = &Package{ID: id} - } - } - } - - // toPkgPath guesses the package path given the id. - toPkgPath := func(sourceDir, id string) (string, error) { - if i := strings.IndexByte(id, ' '); i >= 0 { - return state.resolveImport(sourceDir, id[:i]) - } - return state.resolveImport(sourceDir, id) - } - - // Now that new packages have been created, do another pass to determine - // the new set of missing packages. - for _, pkg := range response.dr.Packages { - for _, imp := range pkg.Imports { - if len(pkg.GoFiles) == 0 { - return nil, nil, fmt.Errorf("cannot resolve imports for package %q with no Go files", pkg.PkgPath) - } - pkgPath, err := toPkgPath(filepath.Dir(pkg.GoFiles[0]), imp.ID) - if err != nil { - return nil, nil, err - } - if _, ok := havePkgs[pkgPath]; !ok { - needPkgsSet[pkgPath] = true - } - } - } - - if overlayAddsImports { - needPkgs = make([]string, 0, len(needPkgsSet)) - for pkg := range needPkgsSet { - needPkgs = append(needPkgs, pkg) - } - } - modifiedPkgs = make([]string, 0, len(modifiedPkgsSet)) - for pkg := range modifiedPkgsSet { - modifiedPkgs = append(modifiedPkgs, pkg) - } - return modifiedPkgs, needPkgs, err -} - -// resolveImport finds the ID of a package given its import path. -// In particular, it will find the right vendored copy when in GOPATH mode. -func (state *golistState) resolveImport(sourceDir, importPath string) (string, error) { - env, err := state.getEnv() - if err != nil { - return "", err - } - if env["GOMOD"] != "" { - return importPath, nil - } - - searchDir := sourceDir - for { - vendorDir := filepath.Join(searchDir, "vendor") - exists, ok := state.vendorDirs[vendorDir] - if !ok { - info, err := os.Stat(vendorDir) - exists = err == nil && info.IsDir() - state.vendorDirs[vendorDir] = exists - } - - if exists { - vendoredPath := filepath.Join(vendorDir, importPath) - if info, err := os.Stat(vendoredPath); err == nil && info.IsDir() { - // We should probably check for .go files here, but shame on anyone who fools us. - path, ok, err := state.getPkgPath(vendoredPath) - if err != nil { - return "", err - } - if ok { - return path, nil - } - } - } - - // We know we've hit the top of the filesystem when we Dir / and get /, - // or C:\ and get C:\, etc. - next := filepath.Dir(searchDir) - if next == searchDir { - break - } - searchDir = next - } - return importPath, nil -} - -func hasTestFiles(p *Package) bool { - for _, f := range p.GoFiles { - if strings.HasSuffix(f, "_test.go") { - return true - } - } - return false -} - // determineRootDirs returns a mapping from absolute directories that could // contain code to their corresponding import path prefixes. func (state *golistState) determineRootDirs() (map[string]string, error) { @@ -384,192 +81,3 @@ func (state *golistState) determineRootDirsGOPATH() (map[string]string, error) { } return m, nil } - -func extractImports(filename string, contents []byte) ([]string, error) { - f, err := parser.ParseFile(token.NewFileSet(), filename, contents, parser.ImportsOnly) // TODO(matloob): reuse fileset? - if err != nil { - return nil, err - } - var res []string - for _, imp := range f.Imports { - quotedPath := imp.Path.Value - path, err := strconv.Unquote(quotedPath) - if err != nil { - return nil, err - } - res = append(res, path) - } - return res, nil -} - -// reclaimPackage attempts to reuse a package that failed to load in an overlay. -// -// If the package has errors and has no Name, GoFiles, or Imports, -// then it's possible that it doesn't yet exist on disk. -func reclaimPackage(pkg *Package, id string, filename string, contents []byte) bool { - // TODO(rstambler): Check the message of the actual error? - // It differs between $GOPATH and module mode. - if pkg.ID != id { - return false - } - if len(pkg.Errors) != 1 { - return false - } - if pkg.Name != "" || pkg.ExportFile != "" { - return false - } - if len(pkg.GoFiles) > 0 || len(pkg.CompiledGoFiles) > 0 || len(pkg.OtherFiles) > 0 { - return false - } - if len(pkg.Imports) > 0 { - return false - } - pkgName, ok := extractPackageName(filename, contents) - if !ok { - return false - } - pkg.Name = pkgName - pkg.Errors = nil - return true -} - -func extractPackageName(filename string, contents []byte) (string, bool) { - // TODO(rstambler): Check the message of the actual error? - // It differs between $GOPATH and module mode. - f, err := parser.ParseFile(token.NewFileSet(), filename, contents, parser.PackageClauseOnly) // TODO(matloob): reuse fileset? - if err != nil { - return "", false - } - return f.Name.Name, true -} - -// commonDir returns the directory that all files are in, "" if files is empty, -// or an error if they aren't in the same directory. -func commonDir(files []string) (string, error) { - seen := make(map[string]bool) - for _, f := range files { - seen[filepath.Dir(f)] = true - } - if len(seen) > 1 { - return "", fmt.Errorf("files (%v) are in more than one directory: %v", files, seen) - } - for k := range seen { - // seen has only one element; return it. - return k, nil - } - return "", nil // no files -} - -// It is possible that the files in the disk directory dir have a different package -// name from newName, which is deduced from the overlays. If they all have a different -// package name, and they all have the same package name, then that name becomes -// the package name. -// It returns true if it changes the package name, false otherwise. -func maybeFixPackageName(newName string, isTestFile bool, pkgsOfDir []*Package) { - names := make(map[string]int) - for _, p := range pkgsOfDir { - names[p.Name]++ - } - if len(names) != 1 { - // some files are in different packages - return - } - var oldName string - for k := range names { - oldName = k - } - if newName == oldName { - return - } - // We might have a case where all of the package names in the directory are - // the same, but the overlay file is for an x test, which belongs to its - // own package. If the x test does not yet exist on disk, we may not yet - // have its package name on disk, but we should not rename the packages. - // - // We use a heuristic to determine if this file belongs to an x test: - // The test file should have a package name whose package name has a _test - // suffix or looks like "newName_test". - maybeXTest := strings.HasPrefix(oldName+"_test", newName) || strings.HasSuffix(newName, "_test") - if isTestFile && maybeXTest { - return - } - for _, p := range pkgsOfDir { - p.Name = newName - } -} - -// This function is copy-pasted from -// https://github.com/golang/go/blob/9706f510a5e2754595d716bd64be8375997311fb/src/cmd/go/internal/search/search.go#L360. -// It should be deleted when we remove support for overlays from go/packages. -// -// NOTE: This does not handle any ./... or ./ style queries, as this function -// doesn't know the working directory. -// -// matchPattern(pattern)(name) reports whether -// name matches pattern. Pattern is a limited glob -// pattern in which '...' means 'any string' and there -// is no other special syntax. -// Unfortunately, there are two special cases. Quoting "go help packages": -// -// First, /... at the end of the pattern can match an empty string, -// so that net/... matches both net and packages in its subdirectories, like net/http. -// Second, any slash-separated pattern element containing a wildcard never -// participates in a match of the "vendor" element in the path of a vendored -// package, so that ./... does not match packages in subdirectories of -// ./vendor or ./mycode/vendor, but ./vendor/... and ./mycode/vendor/... do. -// Note, however, that a directory named vendor that itself contains code -// is not a vendored package: cmd/vendor would be a command named vendor, -// and the pattern cmd/... matches it. -func matchPattern(pattern string) func(name string) bool { - // Convert pattern to regular expression. - // The strategy for the trailing /... is to nest it in an explicit ? expression. - // The strategy for the vendor exclusion is to change the unmatchable - // vendor strings to a disallowed code point (vendorChar) and to use - // "(anything but that codepoint)*" as the implementation of the ... wildcard. - // This is a bit complicated but the obvious alternative, - // namely a hand-written search like in most shell glob matchers, - // is too easy to make accidentally exponential. - // Using package regexp guarantees linear-time matching. - - const vendorChar = "\x00" - - if strings.Contains(pattern, vendorChar) { - return func(name string) bool { return false } - } - - re := regexp.QuoteMeta(pattern) - re = replaceVendor(re, vendorChar) - switch { - case strings.HasSuffix(re, `/`+vendorChar+`/\.\.\.`): - re = strings.TrimSuffix(re, `/`+vendorChar+`/\.\.\.`) + `(/vendor|/` + vendorChar + `/\.\.\.)` - case re == vendorChar+`/\.\.\.`: - re = `(/vendor|/` + vendorChar + `/\.\.\.)` - case strings.HasSuffix(re, `/\.\.\.`): - re = strings.TrimSuffix(re, `/\.\.\.`) + `(/\.\.\.)?` - } - re = strings.ReplaceAll(re, `\.\.\.`, `[^`+vendorChar+`]*`) - - reg := regexp.MustCompile(`^` + re + `$`) - - return func(name string) bool { - if strings.Contains(name, vendorChar) { - return false - } - return reg.MatchString(replaceVendor(name, vendorChar)) - } -} - -// replaceVendor returns the result of replacing -// non-trailing vendor path elements in x with repl. -func replaceVendor(x, repl string) string { - if !strings.Contains(x, "vendor") { - return x - } - elem := strings.Split(x, "/") - for i := 0; i < len(elem)-1; i++ { - if elem[i] == "vendor" { - elem[i] = repl - } - } - return strings.Join(elem, "/") -} diff --git a/vendor/golang.org/x/tools/go/packages/packages.go b/vendor/golang.org/x/tools/go/packages/packages.go index 124a6fe143b1..f33b0afc22cf 100644 --- a/vendor/golang.org/x/tools/go/packages/packages.go +++ b/vendor/golang.org/x/tools/go/packages/packages.go @@ -16,7 +16,6 @@ import ( "go/token" "go/types" "io" - "io/ioutil" "log" "os" "path/filepath" @@ -28,8 +27,8 @@ import ( "golang.org/x/tools/go/gcexportdata" "golang.org/x/tools/internal/gocommand" "golang.org/x/tools/internal/packagesinternal" - "golang.org/x/tools/internal/typeparams" "golang.org/x/tools/internal/typesinternal" + "golang.org/x/tools/internal/versions" ) // A LoadMode controls the amount of detail to return when loading. @@ -207,43 +206,6 @@ type Config struct { Overlay map[string][]byte } -// driver is the type for functions that query the build system for the -// packages named by the patterns. -type driver func(cfg *Config, patterns ...string) (*driverResponse, error) - -// driverResponse contains the results for a driver query. -type driverResponse struct { - // NotHandled is returned if the request can't be handled by the current - // driver. If an external driver returns a response with NotHandled, the - // rest of the driverResponse is ignored, and go/packages will fallback - // to the next driver. If go/packages is extended in the future to support - // lists of multiple drivers, go/packages will fall back to the next driver. - NotHandled bool - - // Compiler and Arch are the arguments pass of types.SizesFor - // to get a types.Sizes to use when type checking. - Compiler string - Arch string - - // Roots is the set of package IDs that make up the root packages. - // We have to encode this separately because when we encode a single package - // we cannot know if it is one of the roots as that requires knowledge of the - // graph it is part of. - Roots []string `json:",omitempty"` - - // Packages is the full set of packages in the graph. - // The packages are not connected into a graph. - // The Imports if populated will be stubs that only have their ID set. - // Imports will be connected and then type and syntax information added in a - // later pass (see refine). - Packages []*Package - - // GoVersion is the minor version number used by the driver - // (e.g. the go command on the PATH) when selecting .go files. - // Zero means unknown. - GoVersion int -} - // Load loads and returns the Go packages named by the given patterns. // // Config specifies loading options; @@ -259,31 +221,55 @@ type driverResponse struct { // proceeding with further analysis. The PrintErrors function is // provided for convenient display of all errors. func Load(cfg *Config, patterns ...string) ([]*Package, error) { - l := newLoader(cfg) - response, err := defaultDriver(&l.Config, patterns...) + ld := newLoader(cfg) + response, external, err := defaultDriver(&ld.Config, patterns...) if err != nil { return nil, err } - l.sizes = types.SizesFor(response.Compiler, response.Arch) - return l.refine(response) + + ld.sizes = types.SizesFor(response.Compiler, response.Arch) + if ld.sizes == nil && ld.Config.Mode&(NeedTypes|NeedTypesSizes|NeedTypesInfo) != 0 { + // Type size information is needed but unavailable. + if external { + // An external driver may fail to populate the Compiler/GOARCH fields, + // especially since they are relatively new (see #63700). + // Provide a sensible fallback in this case. + ld.sizes = types.SizesFor("gc", runtime.GOARCH) + if ld.sizes == nil { // gccgo-only arch + ld.sizes = types.SizesFor("gc", "amd64") + } + } else { + // Go list should never fail to deliver accurate size information. + // Reject the whole Load since the error is the same for every package. + return nil, fmt.Errorf("can't determine type sizes for compiler %q on GOARCH %q", + response.Compiler, response.Arch) + } + } + + return ld.refine(response) } // defaultDriver is a driver that implements go/packages' fallback behavior. // It will try to request to an external driver, if one exists. If there's // no external driver, or the driver returns a response with NotHandled set, // defaultDriver will fall back to the go list driver. -func defaultDriver(cfg *Config, patterns ...string) (*driverResponse, error) { - driver := findExternalDriver(cfg) - if driver == nil { - driver = goListDriver +// The boolean result indicates that an external driver handled the request. +func defaultDriver(cfg *Config, patterns ...string) (*DriverResponse, bool, error) { + if driver := findExternalDriver(cfg); driver != nil { + response, err := driver(cfg, patterns...) + if err != nil { + return nil, false, err + } else if !response.NotHandled { + return response, true, nil + } + // (fall through) } - response, err := driver(cfg, patterns...) + + response, err := goListDriver(cfg, patterns...) if err != nil { - return response, err - } else if response.NotHandled { - return goListDriver(cfg, patterns...) + return nil, false, err } - return response, nil + return response, false, nil } // A Package describes a loaded Go package. @@ -412,12 +398,6 @@ func init() { packagesinternal.GetDepsErrors = func(p interface{}) []*packagesinternal.PackageError { return p.(*Package).depsErrors } - packagesinternal.GetGoCmdRunner = func(config interface{}) *gocommand.Runner { - return config.(*Config).gocmdRunner - } - packagesinternal.SetGoCmdRunner = func(config interface{}, runner *gocommand.Runner) { - config.(*Config).gocmdRunner = runner - } packagesinternal.SetModFile = func(config interface{}, value string) { config.(*Config).modFile = value } @@ -554,7 +534,7 @@ type loaderPackage struct { type loader struct { pkgs map[string]*loaderPackage Config - sizes types.Sizes + sizes types.Sizes // non-nil if needed by mode parseCache map[string]*parseValue parseCacheMu sync.Mutex exportMu sync.Mutex // enforces mutual exclusion of exportdata operations @@ -634,7 +614,7 @@ func newLoader(cfg *Config) *loader { // refine connects the supplied packages into a graph and then adds type // and syntax information as requested by the LoadMode. -func (ld *loader) refine(response *driverResponse) ([]*Package, error) { +func (ld *loader) refine(response *DriverResponse) ([]*Package, error) { roots := response.Roots rootMap := make(map[string]int, len(roots)) for i, root := range roots { @@ -679,39 +659,38 @@ func (ld *loader) refine(response *driverResponse) ([]*Package, error) { } } - // Materialize the import graph. - - const ( - white = 0 // new - grey = 1 // in progress - black = 2 // complete - ) - - // visit traverses the import graph, depth-first, - // and materializes the graph as Packages.Imports. - // - // Valid imports are saved in the Packages.Import map. - // Invalid imports (cycles and missing nodes) are saved in the importErrors map. - // Thus, even in the presence of both kinds of errors, the Import graph remains a DAG. - // - // visit returns whether the package needs src or has a transitive - // dependency on a package that does. These are the only packages - // for which we load source code. - var stack []*loaderPackage - var visit func(lpkg *loaderPackage) bool - var srcPkgs []*loaderPackage - visit = func(lpkg *loaderPackage) bool { - switch lpkg.color { - case black: - return lpkg.needsrc - case grey: - panic("internal error: grey node") - } - lpkg.color = grey - stack = append(stack, lpkg) // push - stubs := lpkg.Imports // the structure form has only stubs with the ID in the Imports - // If NeedImports isn't set, the imports fields will all be zeroed out. - if ld.Mode&NeedImports != 0 { + if ld.Mode&NeedImports != 0 { + // Materialize the import graph. + + const ( + white = 0 // new + grey = 1 // in progress + black = 2 // complete + ) + + // visit traverses the import graph, depth-first, + // and materializes the graph as Packages.Imports. + // + // Valid imports are saved in the Packages.Import map. + // Invalid imports (cycles and missing nodes) are saved in the importErrors map. + // Thus, even in the presence of both kinds of errors, + // the Import graph remains a DAG. + // + // visit returns whether the package needs src or has a transitive + // dependency on a package that does. These are the only packages + // for which we load source code. + var stack []*loaderPackage + var visit func(lpkg *loaderPackage) bool + visit = func(lpkg *loaderPackage) bool { + switch lpkg.color { + case black: + return lpkg.needsrc + case grey: + panic("internal error: grey node") + } + lpkg.color = grey + stack = append(stack, lpkg) // push + stubs := lpkg.Imports // the structure form has only stubs with the ID in the Imports lpkg.Imports = make(map[string]*Package, len(stubs)) for importPath, ipkg := range stubs { var importErr error @@ -735,40 +714,39 @@ func (ld *loader) refine(response *driverResponse) ([]*Package, error) { } lpkg.Imports[importPath] = imp.Package } - } - if lpkg.needsrc { - srcPkgs = append(srcPkgs, lpkg) - } - if ld.Mode&NeedTypesSizes != 0 { - lpkg.TypesSizes = ld.sizes - } - stack = stack[:len(stack)-1] // pop - lpkg.color = black - return lpkg.needsrc - } + // Complete type information is required for the + // immediate dependencies of each source package. + if lpkg.needsrc && ld.Mode&NeedTypes != 0 { + for _, ipkg := range lpkg.Imports { + ld.pkgs[ipkg.ID].needtypes = true + } + } - if ld.Mode&NeedImports == 0 { - // We do this to drop the stub import packages that we are not even going to try to resolve. - for _, lpkg := range initial { - lpkg.Imports = nil + // NeedTypeSizes causes TypeSizes to be set even + // on packages for which types aren't needed. + if ld.Mode&NeedTypesSizes != 0 { + lpkg.TypesSizes = ld.sizes + } + stack = stack[:len(stack)-1] // pop + lpkg.color = black + + return lpkg.needsrc } - } else { + // For each initial package, create its import DAG. for _, lpkg := range initial { visit(lpkg) } - } - if ld.Mode&NeedImports != 0 && ld.Mode&NeedTypes != 0 { - for _, lpkg := range srcPkgs { - // Complete type information is required for the - // immediate dependencies of each source package. - for _, ipkg := range lpkg.Imports { - imp := ld.pkgs[ipkg.ID] - imp.needtypes = true - } + + } else { + // !NeedImports: drop the stub (ID-only) import packages + // that we are not even going to try to resolve. + for _, lpkg := range initial { + lpkg.Imports = nil } } + // Load type data and syntax if needed, starting at // the initial packages (roots of the import DAG). if ld.Mode&NeedTypes != 0 || ld.Mode&NeedSyntax != 0 { @@ -1002,10 +980,11 @@ func (ld *loader) loadPackage(lpkg *loaderPackage) { Defs: make(map[*ast.Ident]types.Object), Uses: make(map[*ast.Ident]types.Object), Implicits: make(map[ast.Node]types.Object), + Instances: make(map[*ast.Ident]types.Instance), Scopes: make(map[ast.Node]*types.Scope), Selections: make(map[*ast.SelectorExpr]*types.Selection), } - typeparams.InitInstanceInfo(lpkg.TypesInfo) + versions.InitFileVersions(lpkg.TypesInfo) lpkg.TypesSizes = ld.sizes importer := importerFunc(func(path string) (*types.Package, error) { @@ -1043,7 +1022,7 @@ func (ld *loader) loadPackage(lpkg *loaderPackage) { IgnoreFuncBodies: ld.Mode&NeedDeps == 0 && !lpkg.initial, Error: appendError, - Sizes: ld.sizes, + Sizes: ld.sizes, // may be nil } if lpkg.Module != nil && lpkg.Module.GoVersion != "" { typesinternal.SetGoVersion(tc, "go"+lpkg.Module.GoVersion) @@ -1127,7 +1106,7 @@ func (ld *loader) parseFile(filename string) (*ast.File, error) { var err error if src == nil { ioLimit <- true // wait - src, err = ioutil.ReadFile(filename) + src, err = os.ReadFile(filename) <-ioLimit // signal } if err != nil { diff --git a/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go b/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go index fa5834baf72b..6a57ce3b1369 100644 --- a/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go +++ b/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go @@ -26,15 +26,16 @@ package objectpath import ( "fmt" "go/types" - "sort" "strconv" "strings" - _ "unsafe" + "golang.org/x/tools/internal/aliases" "golang.org/x/tools/internal/typeparams" "golang.org/x/tools/internal/typesinternal" ) +// TODO(adonovan): think about generic aliases. + // A Path is an opaque name that identifies a types.Object // relative to its package. Conceptually, the name consists of a // sequence of destructuring operations applied to the package scope @@ -123,20 +124,7 @@ func For(obj types.Object) (Path, error) { // An Encoder amortizes the cost of encoding the paths of multiple objects. // The zero value of an Encoder is ready to use. type Encoder struct { - scopeMemo map[*types.Scope][]types.Object // memoization of scopeObjects - namedMethodsMemo map[*types.Named][]*types.Func // memoization of namedMethods() - skipMethodSorting bool -} - -// Expose back doors so that gopls can avoid method sorting, which can dominate -// analysis on certain repositories. -// -// TODO(golang/go#61443): remove this. -func init() { - typesinternal.SkipEncoderMethodSorting = func(enc interface{}) { - enc.(*Encoder).skipMethodSorting = true - } - typesinternal.ObjectpathObject = object + scopeMemo map[*types.Scope][]types.Object // memoization of scopeObjects } // For returns the path to an object relative to its package, @@ -239,7 +227,7 @@ func (enc *Encoder) For(obj types.Object) (Path, error) { // Reject obviously non-viable cases. switch obj := obj.(type) { case *types.TypeName: - if _, ok := obj.Type().(*typeparams.TypeParam); !ok { + if _, ok := aliases.Unalias(obj.Type()).(*types.TypeParam); !ok { // With the exception of type parameters, only package-level type names // have a path. return "", fmt.Errorf("no path for %v", obj) @@ -299,7 +287,7 @@ func (enc *Encoder) For(obj types.Object) (Path, error) { } } else { if named, _ := T.(*types.Named); named != nil { - if r := findTypeParam(obj, typeparams.ForNamed(named), path, nil); r != nil { + if r := findTypeParam(obj, named.TypeParams(), path, nil); r != nil { // generic named type return Path(r), nil } @@ -326,33 +314,20 @@ func (enc *Encoder) For(obj types.Object) (Path, error) { } // Inspect declared methods of defined types. - if T, ok := o.Type().(*types.Named); ok { + if T, ok := aliases.Unalias(o.Type()).(*types.Named); ok { path = append(path, opType) - if !enc.skipMethodSorting { - // Note that method index here is always with respect - // to canonical ordering of methods, regardless of how - // they appear in the underlying type. - for i, m := range enc.namedMethods(T) { - path2 := appendOpArg(path, opMethod, i) - if m == obj { - return Path(path2), nil // found declared method - } - if r := find(obj, m.Type(), append(path2, opType), nil); r != nil { - return Path(r), nil - } + // The method index here is always with respect + // to the underlying go/types data structures, + // which ultimately derives from source order + // and must be preserved by export data. + for i := 0; i < T.NumMethods(); i++ { + m := T.Method(i) + path2 := appendOpArg(path, opMethod, i) + if m == obj { + return Path(path2), nil // found declared method } - } else { - // This branch must match the logic in the branch above, using go/types - // APIs without sorting. - for i := 0; i < T.NumMethods(); i++ { - m := T.Method(i) - path2 := appendOpArg(path, opMethod, i) - if m == obj { - return Path(path2), nil // found declared method - } - if r := find(obj, m.Type(), append(path2, opType), nil); r != nil { - return Path(r), nil - } + if r := find(obj, m.Type(), append(path2, opType), nil); r != nil { + return Path(r), nil } } } @@ -424,13 +399,8 @@ func (enc *Encoder) concreteMethod(meth *types.Func) (Path, bool) { return "", false } - recvT := meth.Type().(*types.Signature).Recv().Type() - if ptr, ok := recvT.(*types.Pointer); ok { - recvT = ptr.Elem() - } - - named, ok := recvT.(*types.Named) - if !ok { + _, named := typesinternal.ReceiverNamed(meth.Type().(*types.Signature).Recv()) + if named == nil { return "", false } @@ -448,22 +418,13 @@ func (enc *Encoder) concreteMethod(meth *types.Func) (Path, bool) { path = append(path, name...) path = append(path, opType) - if !enc.skipMethodSorting { - for i, m := range enc.namedMethods(named) { - if m == meth { - path = appendOpArg(path, opMethod, i) - return Path(path), true - } - } - } else { - // This branch must match the logic of the branch above, using go/types - // APIs without sorting. - for i := 0; i < named.NumMethods(); i++ { - m := named.Method(i) - if m == meth { - path = appendOpArg(path, opMethod, i) - return Path(path), true - } + // Method indices are w.r.t. the go/types data structures, + // ultimately deriving from source order, + // which is preserved by export data. + for i := 0; i < named.NumMethods(); i++ { + if named.Method(i) == meth { + path = appendOpArg(path, opMethod, i) + return Path(path), true } } @@ -482,6 +443,8 @@ func (enc *Encoder) concreteMethod(meth *types.Func) (Path, bool) { // nil, it will be allocated as necessary. func find(obj types.Object, T types.Type, path []byte, seen map[*types.TypeName]bool) []byte { switch T := T.(type) { + case *aliases.Alias: + return find(obj, aliases.Unalias(T), path, seen) case *types.Basic, *types.Named: // Named types belonging to pkg were handled already, // so T must belong to another package. No path. @@ -500,7 +463,7 @@ func find(obj types.Object, T types.Type, path []byte, seen map[*types.TypeName] } return find(obj, T.Elem(), append(path, opElem), seen) case *types.Signature: - if r := findTypeParam(obj, typeparams.ForSignature(T), path, seen); r != nil { + if r := findTypeParam(obj, T.TypeParams(), path, seen); r != nil { return r } if r := find(obj, T.Params(), append(path, opParams), seen); r != nil { @@ -543,7 +506,7 @@ func find(obj types.Object, T types.Type, path []byte, seen map[*types.TypeName] } } return nil - case *typeparams.TypeParam: + case *types.TypeParam: name := T.Obj() if name == obj { return append(path, opObj) @@ -563,7 +526,7 @@ func find(obj types.Object, T types.Type, path []byte, seen map[*types.TypeName] panic(T) } -func findTypeParam(obj types.Object, list *typeparams.TypeParamList, path []byte, seen map[*types.TypeName]bool) []byte { +func findTypeParam(obj types.Object, list *types.TypeParamList, path []byte, seen map[*types.TypeName]bool) []byte { for i := 0; i < list.Len(); i++ { tparam := list.At(i) path2 := appendOpArg(path, opTypeParam, i) @@ -576,12 +539,7 @@ func findTypeParam(obj types.Object, list *typeparams.TypeParamList, path []byte // Object returns the object denoted by path p within the package pkg. func Object(pkg *types.Package, p Path) (types.Object, error) { - return object(pkg, string(p), false) -} - -// Note: the skipMethodSorting parameter must match the value of -// Encoder.skipMethodSorting used during encoding. -func object(pkg *types.Package, pathstr string, skipMethodSorting bool) (types.Object, error) { + pathstr := string(p) if pathstr == "" { return nil, fmt.Errorf("empty path") } @@ -605,7 +563,7 @@ func object(pkg *types.Package, pathstr string, skipMethodSorting bool) (types.O } // abstraction of *types.{Named,Signature} type hasTypeParams interface { - TypeParams() *typeparams.TypeParamList + TypeParams() *types.TypeParamList } // abstraction of *types.{Named,TypeParam} type hasObj interface { @@ -659,6 +617,7 @@ func object(pkg *types.Package, pathstr string, skipMethodSorting bool) (types.O // Inv: t != nil, obj == nil + t = aliases.Unalias(t) switch code { case opElem: hasElem, ok := t.(hasElem) // Pointer, Slice, Array, Chan, Map @@ -707,7 +666,7 @@ func object(pkg *types.Package, pathstr string, skipMethodSorting bool) (types.O t = tparams.At(index) case opConstraint: - tparam, ok := t.(*typeparams.TypeParam) + tparam, ok := t.(*types.TypeParam) if !ok { return nil, fmt.Errorf("cannot apply %q to %s (got %T, want type parameter)", code, t, t) } @@ -747,12 +706,7 @@ func object(pkg *types.Package, pathstr string, skipMethodSorting bool) (types.O if index >= t.NumMethods() { return nil, fmt.Errorf("method index %d out of range [0-%d)", index, t.NumMethods()) } - if skipMethodSorting { - obj = t.Method(index) - } else { - methods := namedMethods(t) // (unmemoized) - obj = methods[index] // Id-ordered - } + obj = t.Method(index) default: return nil, fmt.Errorf("cannot apply %q to %s (got %T, want interface or named)", code, t, t) @@ -779,33 +733,6 @@ func object(pkg *types.Package, pathstr string, skipMethodSorting bool) (types.O return obj, nil // success } -// namedMethods returns the methods of a Named type in ascending Id order. -func namedMethods(named *types.Named) []*types.Func { - methods := make([]*types.Func, named.NumMethods()) - for i := range methods { - methods[i] = named.Method(i) - } - sort.Slice(methods, func(i, j int) bool { - return methods[i].Id() < methods[j].Id() - }) - return methods -} - -// namedMethods is a memoization of the namedMethods function. Callers must not modify the result. -func (enc *Encoder) namedMethods(named *types.Named) []*types.Func { - m := enc.namedMethodsMemo - if m == nil { - m = make(map[*types.Named][]*types.Func) - enc.namedMethodsMemo = m - } - methods, ok := m[named] - if !ok { - methods = namedMethods(named) // allocates and sorts - m[named] = methods - } - return methods -} - // scopeObjects is a memoization of scope objects. // Callers must not modify the result. func (enc *Encoder) scopeObjects(scope *types.Scope) []types.Object { diff --git a/vendor/golang.org/x/tools/imports/forward.go b/vendor/golang.org/x/tools/imports/forward.go index d2547c743382..cb6db8893f94 100644 --- a/vendor/golang.org/x/tools/imports/forward.go +++ b/vendor/golang.org/x/tools/imports/forward.go @@ -7,8 +7,8 @@ package imports // import "golang.org/x/tools/imports" import ( - "io/ioutil" "log" + "os" "golang.org/x/tools/internal/gocommand" intimp "golang.org/x/tools/internal/imports" @@ -44,7 +44,7 @@ var LocalPrefix string func Process(filename string, src []byte, opt *Options) ([]byte, error) { var err error if src == nil { - src, err = ioutil.ReadFile(filename) + src, err = os.ReadFile(filename) if err != nil { return nil, err } diff --git a/vendor/golang.org/x/tools/internal/aliases/aliases.go b/vendor/golang.org/x/tools/internal/aliases/aliases.go new file mode 100644 index 000000000000..f89112c8ee57 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/aliases/aliases.go @@ -0,0 +1,28 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package aliases + +import ( + "go/token" + "go/types" +) + +// Package aliases defines backward compatible shims +// for the types.Alias type representation added in 1.22. +// This defines placeholders for x/tools until 1.26. + +// NewAlias creates a new TypeName in Package pkg that +// is an alias for the type rhs. +// +// When GoVersion>=1.22 and GODEBUG=gotypesalias=1, +// the Type() of the return value is a *types.Alias. +func NewAlias(pos token.Pos, pkg *types.Package, name string, rhs types.Type) *types.TypeName { + if enabled() { + tname := types.NewTypeName(pos, pkg, name, nil) + newAlias(tname, rhs) + return tname + } + return types.NewTypeName(pos, pkg, name, rhs) +} diff --git a/vendor/golang.org/x/tools/internal/aliases/aliases_go121.go b/vendor/golang.org/x/tools/internal/aliases/aliases_go121.go new file mode 100644 index 000000000000..1872b56ff8fc --- /dev/null +++ b/vendor/golang.org/x/tools/internal/aliases/aliases_go121.go @@ -0,0 +1,30 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !go1.22 +// +build !go1.22 + +package aliases + +import ( + "go/types" +) + +// Alias is a placeholder for a go/types.Alias for <=1.21. +// It will never be created by go/types. +type Alias struct{} + +func (*Alias) String() string { panic("unreachable") } + +func (*Alias) Underlying() types.Type { panic("unreachable") } + +func (*Alias) Obj() *types.TypeName { panic("unreachable") } + +// Unalias returns the type t for go <=1.21. +func Unalias(t types.Type) types.Type { return t } + +// Always false for go <=1.21. Ignores GODEBUG. +func enabled() bool { return false } + +func newAlias(name *types.TypeName, rhs types.Type) *Alias { panic("unreachable") } diff --git a/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go b/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go new file mode 100644 index 000000000000..8b92116284d0 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go @@ -0,0 +1,72 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.22 +// +build go1.22 + +package aliases + +import ( + "go/ast" + "go/parser" + "go/token" + "go/types" + "os" + "strings" + "sync" +) + +// Alias is an alias of types.Alias. +type Alias = types.Alias + +// Unalias is a wrapper of types.Unalias. +func Unalias(t types.Type) types.Type { return types.Unalias(t) } + +// newAlias is an internal alias around types.NewAlias. +// Direct usage is discouraged as the moment. +// Try to use NewAlias instead. +func newAlias(tname *types.TypeName, rhs types.Type) *Alias { + a := types.NewAlias(tname, rhs) + // TODO(go.dev/issue/65455): Remove kludgy workaround to set a.actual as a side-effect. + Unalias(a) + return a +} + +// enabled returns true when types.Aliases are enabled. +func enabled() bool { + // Use the gotypesalias value in GODEBUG if set. + godebug := os.Getenv("GODEBUG") + value := -1 // last set value. + for _, f := range strings.Split(godebug, ",") { + switch f { + case "gotypesalias=1": + value = 1 + case "gotypesalias=0": + value = 0 + } + } + switch value { + case 0: + return false + case 1: + return true + default: + return aliasesDefault() + } +} + +// aliasesDefault reports if aliases are enabled by default. +func aliasesDefault() bool { + // Dynamically check if Aliases will be produced from go/types. + aliasesDefaultOnce.Do(func() { + fset := token.NewFileSet() + f, _ := parser.ParseFile(fset, "a.go", "package p; type A = int", 0) + pkg, _ := new(types.Config).Check("p", fset, []*ast.File{f}, nil) + _, gotypesaliasDefault = pkg.Scope().Lookup("A").Type().(*types.Alias) + }) + return gotypesaliasDefault +} + +var gotypesaliasDefault bool +var aliasesDefaultOnce sync.Once diff --git a/vendor/golang.org/x/tools/internal/event/keys/util.go b/vendor/golang.org/x/tools/internal/event/keys/util.go new file mode 100644 index 000000000000..c0e8e731c900 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/event/keys/util.go @@ -0,0 +1,21 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package keys + +import ( + "sort" + "strings" +) + +// Join returns a canonical join of the keys in S: +// a sorted comma-separated string list. +func Join[S ~[]T, T ~string](s S) string { + strs := make([]string, 0, len(s)) + for _, v := range s { + strs = append(strs, string(v)) + } + sort.Strings(strs) + return strings.Join(strs, ",") +} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go deleted file mode 100644 index c40c7e931066..000000000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package fastwalk provides a faster version of [filepath.Walk] for file system -// scanning tools. -package fastwalk - -import ( - "errors" - "os" - "path/filepath" - "runtime" - "sync" -) - -// ErrTraverseLink is used as a return value from WalkFuncs to indicate that the -// symlink named in the call may be traversed. -var ErrTraverseLink = errors.New("fastwalk: traverse symlink, assuming target is a directory") - -// ErrSkipFiles is a used as a return value from WalkFuncs to indicate that the -// callback should not be called for any other files in the current directory. -// Child directories will still be traversed. -var ErrSkipFiles = errors.New("fastwalk: skip remaining files in directory") - -// Walk is a faster implementation of [filepath.Walk]. -// -// [filepath.Walk]'s design necessarily calls [os.Lstat] on each file, -// even if the caller needs less info. -// Many tools need only the type of each file. -// On some platforms, this information is provided directly by the readdir -// system call, avoiding the need to stat each file individually. -// fastwalk_unix.go contains a fork of the syscall routines. -// -// See golang.org/issue/16399. -// -// Walk walks the file tree rooted at root, calling walkFn for -// each file or directory in the tree, including root. -// -// If Walk returns [filepath.SkipDir], the directory is skipped. -// -// Unlike [filepath.Walk]: -// - file stat calls must be done by the user. -// The only provided metadata is the file type, which does not include -// any permission bits. -// - multiple goroutines stat the filesystem concurrently. The provided -// walkFn must be safe for concurrent use. -// - Walk can follow symlinks if walkFn returns the TraverseLink -// sentinel error. It is the walkFn's responsibility to prevent -// Walk from going into symlink cycles. -func Walk(root string, walkFn func(path string, typ os.FileMode) error) error { - // TODO(bradfitz): make numWorkers configurable? We used a - // minimum of 4 to give the kernel more info about multiple - // things we want, in hopes its I/O scheduling can take - // advantage of that. Hopefully most are in cache. Maybe 4 is - // even too low of a minimum. Profile more. - numWorkers := 4 - if n := runtime.NumCPU(); n > numWorkers { - numWorkers = n - } - - // Make sure to wait for all workers to finish, otherwise - // walkFn could still be called after returning. This Wait call - // runs after close(e.donec) below. - var wg sync.WaitGroup - defer wg.Wait() - - w := &walker{ - fn: walkFn, - enqueuec: make(chan walkItem, numWorkers), // buffered for performance - workc: make(chan walkItem, numWorkers), // buffered for performance - donec: make(chan struct{}), - - // buffered for correctness & not leaking goroutines: - resc: make(chan error, numWorkers), - } - defer close(w.donec) - - for i := 0; i < numWorkers; i++ { - wg.Add(1) - go w.doWork(&wg) - } - todo := []walkItem{{dir: root}} - out := 0 - for { - workc := w.workc - var workItem walkItem - if len(todo) == 0 { - workc = nil - } else { - workItem = todo[len(todo)-1] - } - select { - case workc <- workItem: - todo = todo[:len(todo)-1] - out++ - case it := <-w.enqueuec: - todo = append(todo, it) - case err := <-w.resc: - out-- - if err != nil { - return err - } - if out == 0 && len(todo) == 0 { - // It's safe to quit here, as long as the buffered - // enqueue channel isn't also readable, which might - // happen if the worker sends both another unit of - // work and its result before the other select was - // scheduled and both w.resc and w.enqueuec were - // readable. - select { - case it := <-w.enqueuec: - todo = append(todo, it) - default: - return nil - } - } - } - } -} - -// doWork reads directories as instructed (via workc) and runs the -// user's callback function. -func (w *walker) doWork(wg *sync.WaitGroup) { - defer wg.Done() - for { - select { - case <-w.donec: - return - case it := <-w.workc: - select { - case <-w.donec: - return - case w.resc <- w.walk(it.dir, !it.callbackDone): - } - } - } -} - -type walker struct { - fn func(path string, typ os.FileMode) error - - donec chan struct{} // closed on fastWalk's return - workc chan walkItem // to workers - enqueuec chan walkItem // from workers - resc chan error // from workers -} - -type walkItem struct { - dir string - callbackDone bool // callback already called; don't do it again -} - -func (w *walker) enqueue(it walkItem) { - select { - case w.enqueuec <- it: - case <-w.donec: - } -} - -func (w *walker) onDirEnt(dirName, baseName string, typ os.FileMode) error { - joined := dirName + string(os.PathSeparator) + baseName - if typ == os.ModeDir { - w.enqueue(walkItem{dir: joined}) - return nil - } - - err := w.fn(joined, typ) - if typ == os.ModeSymlink { - if err == ErrTraverseLink { - // Set callbackDone so we don't call it twice for both the - // symlink-as-symlink and the symlink-as-directory later: - w.enqueue(walkItem{dir: joined, callbackDone: true}) - return nil - } - if err == filepath.SkipDir { - // Permit SkipDir on symlinks too. - return nil - } - } - return err -} - -func (w *walker) walk(root string, runUserCallback bool) error { - if runUserCallback { - err := w.fn(root, os.ModeDir) - if err == filepath.SkipDir { - return nil - } - if err != nil { - return err - } - } - - return readDir(root, w.onDirEnt) -} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_darwin.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_darwin.go deleted file mode 100644 index 0ca55e0d56f2..000000000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_darwin.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build darwin && cgo -// +build darwin,cgo - -package fastwalk - -/* -#include - -// fastwalk_readdir_r wraps readdir_r so that we don't have to pass a dirent** -// result pointer which triggers CGO's "Go pointer to Go pointer" check unless -// we allocat the result dirent* with malloc. -// -// fastwalk_readdir_r returns 0 on success, -1 upon reaching the end of the -// directory, or a positive error number to indicate failure. -static int fastwalk_readdir_r(DIR *fd, struct dirent *entry) { - struct dirent *result; - int ret = readdir_r(fd, entry, &result); - if (ret == 0 && result == NULL) { - ret = -1; // EOF - } - return ret; -} -*/ -import "C" - -import ( - "os" - "syscall" - "unsafe" -) - -func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error { - fd, err := openDir(dirName) - if err != nil { - return &os.PathError{Op: "opendir", Path: dirName, Err: err} - } - defer C.closedir(fd) - - skipFiles := false - var dirent syscall.Dirent - for { - ret := int(C.fastwalk_readdir_r(fd, (*C.struct_dirent)(unsafe.Pointer(&dirent)))) - if ret != 0 { - if ret == -1 { - break // EOF - } - if ret == int(syscall.EINTR) { - continue - } - return &os.PathError{Op: "readdir", Path: dirName, Err: syscall.Errno(ret)} - } - if dirent.Ino == 0 { - continue - } - typ := dtToType(dirent.Type) - if skipFiles && typ.IsRegular() { - continue - } - name := (*[len(syscall.Dirent{}.Name)]byte)(unsafe.Pointer(&dirent.Name))[:] - name = name[:dirent.Namlen] - for i, c := range name { - if c == 0 { - name = name[:i] - break - } - } - // Check for useless names before allocating a string. - if string(name) == "." || string(name) == ".." { - continue - } - if err := fn(dirName, string(name), typ); err != nil { - if err != ErrSkipFiles { - return err - } - skipFiles = true - } - } - - return nil -} - -func dtToType(typ uint8) os.FileMode { - switch typ { - case syscall.DT_BLK: - return os.ModeDevice - case syscall.DT_CHR: - return os.ModeDevice | os.ModeCharDevice - case syscall.DT_DIR: - return os.ModeDir - case syscall.DT_FIFO: - return os.ModeNamedPipe - case syscall.DT_LNK: - return os.ModeSymlink - case syscall.DT_REG: - return 0 - case syscall.DT_SOCK: - return os.ModeSocket - } - return ^os.FileMode(0) -} - -// openDir wraps opendir(3) and handles any EINTR errors. The returned *DIR -// needs to be closed with closedir(3). -func openDir(path string) (*C.DIR, error) { - name, err := syscall.BytePtrFromString(path) - if err != nil { - return nil, err - } - for { - fd, err := C.opendir((*C.char)(unsafe.Pointer(name))) - if err != syscall.EINTR { - return fd, err - } - } -} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go deleted file mode 100644 index d58595dbd3f6..000000000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build freebsd || openbsd || netbsd -// +build freebsd openbsd netbsd - -package fastwalk - -import "syscall" - -func direntInode(dirent *syscall.Dirent) uint64 { - return uint64(dirent.Fileno) -} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go deleted file mode 100644 index d3922890b0b1..000000000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build (linux || (darwin && !cgo)) && !appengine -// +build linux darwin,!cgo -// +build !appengine - -package fastwalk - -import "syscall" - -func direntInode(dirent *syscall.Dirent) uint64 { - return dirent.Ino -} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go deleted file mode 100644 index 38a4db6af3ae..000000000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build (darwin && !cgo) || freebsd || openbsd || netbsd -// +build darwin,!cgo freebsd openbsd netbsd - -package fastwalk - -import "syscall" - -func direntNamlen(dirent *syscall.Dirent) uint64 { - return uint64(dirent.Namlen) -} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go deleted file mode 100644 index c82e57df85ef..000000000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build linux && !appengine -// +build linux,!appengine - -package fastwalk - -import ( - "bytes" - "syscall" - "unsafe" -) - -func direntNamlen(dirent *syscall.Dirent) uint64 { - const fixedHdr = uint16(unsafe.Offsetof(syscall.Dirent{}.Name)) - nameBuf := (*[unsafe.Sizeof(dirent.Name)]byte)(unsafe.Pointer(&dirent.Name[0])) - const nameBufLen = uint16(len(nameBuf)) - limit := dirent.Reclen - fixedHdr - if limit > nameBufLen { - limit = nameBufLen - } - nameLen := bytes.IndexByte(nameBuf[:limit], 0) - if nameLen < 0 { - panic("failed to find terminating 0 byte in dirent") - } - return uint64(nameLen) -} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go deleted file mode 100644 index 085d311600be..000000000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build appengine || (!linux && !darwin && !freebsd && !openbsd && !netbsd) -// +build appengine !linux,!darwin,!freebsd,!openbsd,!netbsd - -package fastwalk - -import ( - "io/ioutil" - "os" -) - -// readDir calls fn for each directory entry in dirName. -// It does not descend into directories or follow symlinks. -// If fn returns a non-nil error, readDir returns with that error -// immediately. -func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error { - fis, err := ioutil.ReadDir(dirName) - if err != nil { - return err - } - skipFiles := false - for _, fi := range fis { - if fi.Mode().IsRegular() && skipFiles { - continue - } - if err := fn(dirName, fi.Name(), fi.Mode()&os.ModeType); err != nil { - if err == ErrSkipFiles { - skipFiles = true - continue - } - return err - } - } - return nil -} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go deleted file mode 100644 index f12f1a734cc9..000000000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build (linux || freebsd || openbsd || netbsd || (darwin && !cgo)) && !appengine -// +build linux freebsd openbsd netbsd darwin,!cgo -// +build !appengine - -package fastwalk - -import ( - "fmt" - "os" - "syscall" - "unsafe" -) - -const blockSize = 8 << 10 - -// unknownFileMode is a sentinel (and bogus) os.FileMode -// value used to represent a syscall.DT_UNKNOWN Dirent.Type. -const unknownFileMode os.FileMode = os.ModeNamedPipe | os.ModeSocket | os.ModeDevice - -func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error { - fd, err := open(dirName, 0, 0) - if err != nil { - return &os.PathError{Op: "open", Path: dirName, Err: err} - } - defer syscall.Close(fd) - - // The buffer must be at least a block long. - buf := make([]byte, blockSize) // stack-allocated; doesn't escape - bufp := 0 // starting read position in buf - nbuf := 0 // end valid data in buf - skipFiles := false - for { - if bufp >= nbuf { - bufp = 0 - nbuf, err = readDirent(fd, buf) - if err != nil { - return os.NewSyscallError("readdirent", err) - } - if nbuf <= 0 { - return nil - } - } - consumed, name, typ := parseDirEnt(buf[bufp:nbuf]) - bufp += consumed - if name == "" || name == "." || name == ".." { - continue - } - // Fallback for filesystems (like old XFS) that don't - // support Dirent.Type and have DT_UNKNOWN (0) there - // instead. - if typ == unknownFileMode { - fi, err := os.Lstat(dirName + "/" + name) - if err != nil { - // It got deleted in the meantime. - if os.IsNotExist(err) { - continue - } - return err - } - typ = fi.Mode() & os.ModeType - } - if skipFiles && typ.IsRegular() { - continue - } - if err := fn(dirName, name, typ); err != nil { - if err == ErrSkipFiles { - skipFiles = true - continue - } - return err - } - } -} - -func parseDirEnt(buf []byte) (consumed int, name string, typ os.FileMode) { - // golang.org/issue/37269 - dirent := &syscall.Dirent{} - copy((*[unsafe.Sizeof(syscall.Dirent{})]byte)(unsafe.Pointer(dirent))[:], buf) - if v := unsafe.Offsetof(dirent.Reclen) + unsafe.Sizeof(dirent.Reclen); uintptr(len(buf)) < v { - panic(fmt.Sprintf("buf size of %d smaller than dirent header size %d", len(buf), v)) - } - if len(buf) < int(dirent.Reclen) { - panic(fmt.Sprintf("buf size %d < record length %d", len(buf), dirent.Reclen)) - } - consumed = int(dirent.Reclen) - if direntInode(dirent) == 0 { // File absent in directory. - return - } - switch dirent.Type { - case syscall.DT_REG: - typ = 0 - case syscall.DT_DIR: - typ = os.ModeDir - case syscall.DT_LNK: - typ = os.ModeSymlink - case syscall.DT_BLK: - typ = os.ModeDevice - case syscall.DT_FIFO: - typ = os.ModeNamedPipe - case syscall.DT_SOCK: - typ = os.ModeSocket - case syscall.DT_UNKNOWN: - typ = unknownFileMode - default: - // Skip weird things. - // It's probably a DT_WHT (http://lwn.net/Articles/325369/) - // or something. Revisit if/when this package is moved outside - // of goimports. goimports only cares about regular files, - // symlinks, and directories. - return - } - - nameBuf := (*[unsafe.Sizeof(dirent.Name)]byte)(unsafe.Pointer(&dirent.Name[0])) - nameLen := direntNamlen(dirent) - - // Special cases for common things: - if nameLen == 1 && nameBuf[0] == '.' { - name = "." - } else if nameLen == 2 && nameBuf[0] == '.' && nameBuf[1] == '.' { - name = ".." - } else { - name = string(nameBuf[:nameLen]) - } - return -} - -// According to https://golang.org/doc/go1.14#runtime -// A consequence of the implementation of preemption is that on Unix systems, including Linux and macOS -// systems, programs built with Go 1.14 will receive more signals than programs built with earlier releases. -// -// This causes syscall.Open and syscall.ReadDirent sometimes fail with EINTR errors. -// We need to retry in this case. -func open(path string, mode int, perm uint32) (fd int, err error) { - for { - fd, err := syscall.Open(path, mode, perm) - if err != syscall.EINTR { - return fd, err - } - } -} - -func readDirent(fd int, buf []byte) (n int, err error) { - for { - nbuf, err := syscall.ReadDirent(fd, buf) - if err != syscall.EINTR { - return nbuf, err - } - } -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go b/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go index b1223713b940..39df91124a46 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go @@ -29,7 +29,6 @@ import ( "go/token" "go/types" "io" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -221,7 +220,7 @@ func Import(packages map[string]*types.Package, path, srcDir string, lookup func switch hdr { case "$$B\n": var data []byte - data, err = ioutil.ReadAll(buf) + data, err = io.ReadAll(buf) if err != nil { break } @@ -260,13 +259,6 @@ func Import(packages map[string]*types.Package, path, srcDir string, lookup func return } -func deref(typ types.Type) types.Type { - if p, _ := typ.(*types.Pointer); p != nil { - return p.Elem() - } - return typ -} - type byPath []*types.Package func (a byPath) Len() int { return len(a) } diff --git a/vendor/golang.org/x/tools/internal/gcimporter/iexport.go b/vendor/golang.org/x/tools/internal/gcimporter/iexport.go index 6103dd7102b3..638fc1d3b86a 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/iexport.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/iexport.go @@ -23,8 +23,8 @@ import ( "strings" "golang.org/x/tools/go/types/objectpath" + "golang.org/x/tools/internal/aliases" "golang.org/x/tools/internal/tokeninternal" - "golang.org/x/tools/internal/typeparams" ) // IExportShallow encodes "shallow" export data for the specified package. @@ -481,7 +481,7 @@ func (p *iexporter) doDecl(obj types.Object) { } // Function. - if typeparams.ForSignature(sig).Len() == 0 { + if sig.TypeParams().Len() == 0 { w.tag('F') } else { w.tag('G') @@ -494,7 +494,7 @@ func (p *iexporter) doDecl(obj types.Object) { // // While importing the type parameters, tparamList computes and records // their export name, so that it can be later used when writing the index. - if tparams := typeparams.ForSignature(sig); tparams.Len() > 0 { + if tparams := sig.TypeParams(); tparams.Len() > 0 { w.tparamList(obj.Name(), tparams, obj.Pkg()) } w.signature(sig) @@ -507,14 +507,14 @@ func (p *iexporter) doDecl(obj types.Object) { case *types.TypeName: t := obj.Type() - if tparam, ok := t.(*typeparams.TypeParam); ok { + if tparam, ok := aliases.Unalias(t).(*types.TypeParam); ok { w.tag('P') w.pos(obj.Pos()) constraint := tparam.Constraint() if p.version >= iexportVersionGo1_18 { implicit := false - if iface, _ := constraint.(*types.Interface); iface != nil { - implicit = typeparams.IsImplicit(iface) + if iface, _ := aliases.Unalias(constraint).(*types.Interface); iface != nil { + implicit = iface.IsImplicit() } w.bool(implicit) } @@ -535,17 +535,17 @@ func (p *iexporter) doDecl(obj types.Object) { panic(internalErrorf("%s is not a defined type", t)) } - if typeparams.ForNamed(named).Len() == 0 { + if named.TypeParams().Len() == 0 { w.tag('T') } else { w.tag('U') } w.pos(obj.Pos()) - if typeparams.ForNamed(named).Len() > 0 { + if named.TypeParams().Len() > 0 { // While importing the type parameters, tparamList computes and records // their export name, so that it can be later used when writing the index. - w.tparamList(obj.Name(), typeparams.ForNamed(named), obj.Pkg()) + w.tparamList(obj.Name(), named.TypeParams(), obj.Pkg()) } underlying := obj.Type().Underlying() @@ -565,7 +565,7 @@ func (p *iexporter) doDecl(obj types.Object) { // Receiver type parameters are type arguments of the receiver type, so // their name must be qualified before exporting recv. - if rparams := typeparams.RecvTypeParams(sig); rparams.Len() > 0 { + if rparams := sig.RecvTypeParams(); rparams.Len() > 0 { prefix := obj.Name() + "." + m.Name() for i := 0; i < rparams.Len(); i++ { rparam := rparams.At(i) @@ -739,20 +739,22 @@ func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { }() } switch t := t.(type) { + // TODO(adonovan): support types.Alias. + case *types.Named: - if targs := typeparams.NamedTypeArgs(t); targs.Len() > 0 { + if targs := t.TypeArgs(); targs.Len() > 0 { w.startType(instanceType) // TODO(rfindley): investigate if this position is correct, and if it // matters. w.pos(t.Obj().Pos()) w.typeList(targs, pkg) - w.typ(typeparams.NamedTypeOrigin(t), pkg) + w.typ(t.Origin(), pkg) return } w.startType(definedType) w.qualifiedType(t.Obj()) - case *typeparams.TypeParam: + case *types.TypeParam: w.startType(typeParamType) w.qualifiedType(t.Obj()) @@ -844,7 +846,7 @@ func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { for i := 0; i < n; i++ { ft := t.EmbeddedType(i) tPkg := pkg - if named, _ := ft.(*types.Named); named != nil { + if named, _ := aliases.Unalias(ft).(*types.Named); named != nil { w.pos(named.Obj().Pos()) } else { w.pos(token.NoPos) @@ -868,7 +870,7 @@ func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { w.signature(sig) } - case *typeparams.Union: + case *types.Union: w.startType(unionType) nt := t.Len() w.uint64(uint64(nt)) @@ -948,14 +950,14 @@ func (w *exportWriter) signature(sig *types.Signature) { } } -func (w *exportWriter) typeList(ts *typeparams.TypeList, pkg *types.Package) { +func (w *exportWriter) typeList(ts *types.TypeList, pkg *types.Package) { w.uint64(uint64(ts.Len())) for i := 0; i < ts.Len(); i++ { w.typ(ts.At(i), pkg) } } -func (w *exportWriter) tparamList(prefix string, list *typeparams.TypeParamList, pkg *types.Package) { +func (w *exportWriter) tparamList(prefix string, list *types.TypeParamList, pkg *types.Package) { ll := uint64(list.Len()) w.uint64(ll) for i := 0; i < list.Len(); i++ { @@ -973,7 +975,7 @@ const blankMarker = "$" // differs from its actual object name: it is prefixed with a qualifier, and // blank type parameter names are disambiguated by their index in the type // parameter list. -func tparamExportName(prefix string, tparam *typeparams.TypeParam) string { +func tparamExportName(prefix string, tparam *types.TypeParam) string { assert(prefix != "") name := tparam.Obj().Name() if name == "_" { diff --git a/vendor/golang.org/x/tools/internal/gcimporter/iimport.go b/vendor/golang.org/x/tools/internal/gcimporter/iimport.go index 8e64cf644fce..4d50eb8e5878 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/iimport.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/iimport.go @@ -22,7 +22,8 @@ import ( "strings" "golang.org/x/tools/go/types/objectpath" - "golang.org/x/tools/internal/typeparams" + "golang.org/x/tools/internal/aliases" + "golang.org/x/tools/internal/typesinternal" ) type intReader struct { @@ -225,6 +226,7 @@ func iimportCommon(fset *token.FileSet, getPackages GetPackagesFunc, data []byte // Gather the relevant packages from the manifest. items := make([]GetPackagesItem, r.uint64()) + uniquePkgPaths := make(map[string]bool) for i := range items { pkgPathOff := r.uint64() pkgPath := p.stringAt(pkgPathOff) @@ -249,6 +251,12 @@ func iimportCommon(fset *token.FileSet, getPackages GetPackagesFunc, data []byte } items[i].nameIndex = nameIndex + + uniquePkgPaths[pkgPath] = true + } + // Debugging #63822; hypothesis: there are duplicate PkgPaths. + if len(uniquePkgPaths) != len(items) { + reportf("found duplicate PkgPaths while reading export data manifest: %v", items) } // Request packages all at once from the client, @@ -321,7 +329,7 @@ func iimportCommon(fset *token.FileSet, getPackages GetPackagesFunc, data []byte // Therefore, we defer calling SetConstraint there, and call it here instead // after all types are complete. for _, d := range p.later { - typeparams.SetTypeParamConstraint(d.t, d.constraint) + d.t.SetConstraint(d.constraint) } for _, typ := range p.interfaceList { @@ -339,7 +347,7 @@ func iimportCommon(fset *token.FileSet, getPackages GetPackagesFunc, data []byte } type setConstraintArgs struct { - t *typeparams.TypeParam + t *types.TypeParam constraint types.Type } @@ -516,7 +524,7 @@ func canReuse(def *types.Named, rhs types.Type) bool { if def == nil { return true } - iface, _ := rhs.(*types.Interface) + iface, _ := aliases.Unalias(rhs).(*types.Interface) if iface == nil { return true } @@ -549,7 +557,7 @@ func (r *importReader) obj(name string) { r.declare(types.NewConst(pos, r.currPkg, name, typ, val)) case 'F', 'G': - var tparams []*typeparams.TypeParam + var tparams []*types.TypeParam if tag == 'G' { tparams = r.tparamList() } @@ -566,7 +574,7 @@ func (r *importReader) obj(name string) { r.declare(obj) if tag == 'U' { tparams := r.tparamList() - typeparams.SetForNamed(named, tparams) + named.SetTypeParams(tparams) } underlying := r.p.typAt(r.uint64(), named).Underlying() @@ -581,14 +589,13 @@ func (r *importReader) obj(name string) { // If the receiver has any targs, set those as the // rparams of the method (since those are the // typeparams being used in the method sig/body). - base := baseType(recv.Type()) - assert(base != nil) - targs := typeparams.NamedTypeArgs(base) - var rparams []*typeparams.TypeParam + _, recvNamed := typesinternal.ReceiverNamed(recv) + targs := recvNamed.TypeArgs() + var rparams []*types.TypeParam if targs.Len() > 0 { - rparams = make([]*typeparams.TypeParam, targs.Len()) + rparams = make([]*types.TypeParam, targs.Len()) for i := range rparams { - rparams[i] = targs.At(i).(*typeparams.TypeParam) + rparams[i] = aliases.Unalias(targs.At(i)).(*types.TypeParam) } } msig := r.signature(recv, rparams, nil) @@ -606,7 +613,7 @@ func (r *importReader) obj(name string) { } name0 := tparamName(name) tn := types.NewTypeName(pos, r.currPkg, name0, nil) - t := typeparams.NewTypeParam(tn, nil) + t := types.NewTypeParam(tn, nil) // To handle recursive references to the typeparam within its // bound, save the partial type in tparamIndex before reading the bounds. @@ -618,11 +625,11 @@ func (r *importReader) obj(name string) { } constraint := r.typ() if implicit { - iface, _ := constraint.(*types.Interface) + iface, _ := aliases.Unalias(constraint).(*types.Interface) if iface == nil { errorf("non-interface constraint marked implicit") } - typeparams.MarkImplicit(iface) + iface.MarkImplicit() } // The constraint type may not be complete, if we // are in the middle of a type recursion involving type @@ -825,7 +832,7 @@ func (r *importReader) typ() types.Type { } func isInterface(t types.Type) bool { - _, ok := t.(*types.Interface) + _, ok := aliases.Unalias(t).(*types.Interface) return ok } @@ -966,7 +973,7 @@ func (r *importReader) doType(base *types.Named) (res types.Type) { // The imported instantiated type doesn't include any methods, so // we must always use the methods of the base (orig) type. // TODO provide a non-nil *Environment - t, _ := typeparams.Instantiate(nil, baseType, targs, false) + t, _ := types.Instantiate(nil, baseType, targs, false) // Workaround for golang/go#61561. See the doc for instanceList for details. r.p.instanceList = append(r.p.instanceList, t) @@ -976,11 +983,11 @@ func (r *importReader) doType(base *types.Named) (res types.Type) { if r.p.version < iexportVersionGenerics { errorf("unexpected instantiation type") } - terms := make([]*typeparams.Term, r.uint64()) + terms := make([]*types.Term, r.uint64()) for i := range terms { - terms[i] = typeparams.NewTerm(r.bool(), r.typ()) + terms[i] = types.NewTerm(r.bool(), r.typ()) } - return typeparams.NewUnion(terms) + return types.NewUnion(terms) } } @@ -1008,23 +1015,23 @@ func (r *importReader) objectPathObject() types.Object { return obj } -func (r *importReader) signature(recv *types.Var, rparams []*typeparams.TypeParam, tparams []*typeparams.TypeParam) *types.Signature { +func (r *importReader) signature(recv *types.Var, rparams []*types.TypeParam, tparams []*types.TypeParam) *types.Signature { params := r.paramList() results := r.paramList() variadic := params.Len() > 0 && r.bool() - return typeparams.NewSignatureType(recv, rparams, tparams, params, results, variadic) + return types.NewSignatureType(recv, rparams, tparams, params, results, variadic) } -func (r *importReader) tparamList() []*typeparams.TypeParam { +func (r *importReader) tparamList() []*types.TypeParam { n := r.uint64() if n == 0 { return nil } - xs := make([]*typeparams.TypeParam, n) + xs := make([]*types.TypeParam, n) for i := range xs { // Note: the standard library importer is tolerant of nil types here, // though would panic in SetTypeParams. - xs[i] = r.typ().(*typeparams.TypeParam) + xs[i] = aliases.Unalias(r.typ()).(*types.TypeParam) } return xs } @@ -1071,13 +1078,3 @@ func (r *importReader) byte() byte { } return x } - -func baseType(typ types.Type) *types.Named { - // pointer receivers are never types.Named types - if p, _ := typ.(*types.Pointer); p != nil { - typ = p.Elem() - } - // receiver base types are always (possibly generic) types.Named types - n, _ := typ.(*types.Named) - return n -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/support_go117.go b/vendor/golang.org/x/tools/internal/gcimporter/support_go117.go deleted file mode 100644 index d892273efb61..000000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/support_go117.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.18 -// +build !go1.18 - -package gcimporter - -import "go/types" - -const iexportVersion = iexportVersionGo1_11 - -func additionalPredeclared() []types.Type { - return nil -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/support_go118.go b/vendor/golang.org/x/tools/internal/gcimporter/support_go118.go index edbe6ea7041d..0cd3b91b65ad 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/support_go118.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/support_go118.go @@ -2,9 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.18 -// +build go1.18 - package gcimporter import "go/types" diff --git a/vendor/golang.org/x/tools/internal/gcimporter/unified_no.go b/vendor/golang.org/x/tools/internal/gcimporter/unified_no.go index 286bf445483d..38b624cadab6 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/unified_no.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/unified_no.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !(go1.18 && goexperiment.unified) -// +build !go1.18 !goexperiment.unified +//go:build !goexperiment.unified +// +build !goexperiment.unified package gcimporter diff --git a/vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go b/vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go index b5d69ffbe682..b5118d0b3a50 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.18 && goexperiment.unified -// +build go1.18,goexperiment.unified +//go:build goexperiment.unified +// +build goexperiment.unified package gcimporter diff --git a/vendor/golang.org/x/tools/internal/gcimporter/ureader_no.go b/vendor/golang.org/x/tools/internal/gcimporter/ureader_no.go deleted file mode 100644 index 8eb20729c2ad..000000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/ureader_no.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.18 -// +build !go1.18 - -package gcimporter - -import ( - "fmt" - "go/token" - "go/types" -) - -func UImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { - err = fmt.Errorf("go/tools compiled with a Go version earlier than 1.18 cannot read unified IR export data") - return -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go b/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go index b977435f626d..f4edc46ab74b 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go @@ -4,9 +4,6 @@ // Derived from go/internal/gcimporter/ureader.go -//go:build go1.18 -// +build go1.18 - package gcimporter import ( @@ -16,6 +13,7 @@ import ( "sort" "strings" + "golang.org/x/tools/internal/aliases" "golang.org/x/tools/internal/pkgbits" ) @@ -553,7 +551,7 @@ func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string) { // If the underlying type is an interface, we need to // duplicate its methods so we can replace the receiver // parameter's type (#49906). - if iface, ok := underlying.(*types.Interface); ok && iface.NumExplicitMethods() != 0 { + if iface, ok := aliases.Unalias(underlying).(*types.Interface); ok && iface.NumExplicitMethods() != 0 { methods := make([]*types.Func, iface.NumExplicitMethods()) for i := range methods { fn := iface.ExplicitMethod(i) diff --git a/vendor/golang.org/x/tools/internal/gocommand/invoke.go b/vendor/golang.org/x/tools/internal/gocommand/invoke.go index 53cf66da0193..55312522dc2d 100644 --- a/vendor/golang.org/x/tools/internal/gocommand/invoke.go +++ b/vendor/golang.org/x/tools/internal/gocommand/invoke.go @@ -13,6 +13,7 @@ import ( "io" "log" "os" + "os/exec" "reflect" "regexp" "runtime" @@ -21,8 +22,6 @@ import ( "sync" "time" - exec "golang.org/x/sys/execabs" - "golang.org/x/tools/internal/event" "golang.org/x/tools/internal/event/keys" "golang.org/x/tools/internal/event/label" @@ -85,6 +84,7 @@ func (runner *Runner) RunPiped(ctx context.Context, inv Invocation, stdout, stde // RunRaw runs the invocation, serializing requests only if they fight over // go.mod changes. +// Postcondition: both error results have same nilness. func (runner *Runner) RunRaw(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { ctx, done := event.Start(ctx, "gocommand.Runner.RunRaw", invLabels(inv)...) defer done() @@ -95,23 +95,24 @@ func (runner *Runner) RunRaw(ctx context.Context, inv Invocation) (*bytes.Buffer stdout, stderr, friendlyErr, err := runner.runConcurrent(ctx, inv) // If we encounter a load concurrency error, we need to retry serially. - if friendlyErr == nil || !modConcurrencyError.MatchString(friendlyErr.Error()) { - return stdout, stderr, friendlyErr, err + if friendlyErr != nil && modConcurrencyError.MatchString(friendlyErr.Error()) { + event.Error(ctx, "Load concurrency error, will retry serially", err) + + // Run serially by calling runPiped. + stdout.Reset() + stderr.Reset() + friendlyErr, err = runner.runPiped(ctx, inv, stdout, stderr) } - event.Error(ctx, "Load concurrency error, will retry serially", err) - // Run serially by calling runPiped. - stdout.Reset() - stderr.Reset() - friendlyErr, err = runner.runPiped(ctx, inv, stdout, stderr) return stdout, stderr, friendlyErr, err } +// Postcondition: both error results have same nilness. func (runner *Runner) runConcurrent(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { // Wait for 1 worker to become available. select { case <-ctx.Done(): - return nil, nil, nil, ctx.Err() + return nil, nil, ctx.Err(), ctx.Err() case runner.inFlight <- struct{}{}: defer func() { <-runner.inFlight }() } @@ -121,6 +122,7 @@ func (runner *Runner) runConcurrent(ctx context.Context, inv Invocation) (*bytes return stdout, stderr, friendlyErr, err } +// Postcondition: both error results have same nilness. func (runner *Runner) runPiped(ctx context.Context, inv Invocation, stdout, stderr io.Writer) (error, error) { // Make sure the runner is always initialized. runner.initialize() @@ -129,7 +131,7 @@ func (runner *Runner) runPiped(ctx context.Context, inv Invocation, stdout, stde // runPiped commands. select { case <-ctx.Done(): - return nil, ctx.Err() + return ctx.Err(), ctx.Err() case runner.serialized <- struct{}{}: defer func() { <-runner.serialized }() } @@ -139,7 +141,7 @@ func (runner *Runner) runPiped(ctx context.Context, inv Invocation, stdout, stde for i := 0; i < maxInFlight; i++ { select { case <-ctx.Done(): - return nil, ctx.Err() + return ctx.Err(), ctx.Err() case runner.inFlight <- struct{}{}: // Make sure we always "return" any workers we took. defer func() { <-runner.inFlight }() @@ -172,6 +174,7 @@ type Invocation struct { Logf func(format string, args ...interface{}) } +// Postcondition: both error results have same nilness. func (i *Invocation) runWithFriendlyError(ctx context.Context, stdout, stderr io.Writer) (friendlyError error, rawError error) { rawError = i.run(ctx, stdout, stderr) if rawError != nil { diff --git a/vendor/golang.org/x/tools/internal/gopathwalk/walk.go b/vendor/golang.org/x/tools/internal/gopathwalk/walk.go index 452e342c559c..8361515519fe 100644 --- a/vendor/golang.org/x/tools/internal/gopathwalk/walk.go +++ b/vendor/golang.org/x/tools/internal/gopathwalk/walk.go @@ -9,21 +9,27 @@ package gopathwalk import ( "bufio" "bytes" - "log" + "io" + "io/fs" "os" "path/filepath" + "runtime" "strings" + "sync" "time" - - "golang.org/x/tools/internal/fastwalk" ) // Options controls the behavior of a Walk call. type Options struct { // If Logf is non-nil, debug logging is enabled through this function. Logf func(format string, args ...interface{}) + // Search module caches. Also disables legacy goimports ignore rules. ModulesEnabled bool + + // Maximum number of concurrent calls to user-provided callbacks, + // or 0 for GOMAXPROCS. + Concurrency int } // RootType indicates the type of a Root. @@ -44,22 +50,28 @@ type Root struct { Type RootType } -// Walk walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. -// For each package found, add will be called (concurrently) with the absolute +// Walk concurrently walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. +// +// For each package found, add will be called with the absolute // paths of the containing source directory and the package directory. -// add will be called concurrently. +// +// Unlike filepath.WalkDir, Walk follows symbolic links +// (while guarding against cycles). func Walk(roots []Root, add func(root Root, dir string), opts Options) { WalkSkip(roots, add, func(Root, string) bool { return false }, opts) } -// WalkSkip walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. -// For each package found, add will be called (concurrently) with the absolute +// WalkSkip concurrently walks Go source directories ($GOROOT, $GOPATH, etc) to +// find packages. +// +// For each package found, add will be called with the absolute // paths of the containing source directory and the package directory. -// For each directory that will be scanned, skip will be called (concurrently) +// For each directory that will be scanned, skip will be called // with the absolute paths of the containing source directory and the directory. // If skip returns false on a directory it will be processed. -// add will be called concurrently. -// skip will be called concurrently. +// +// Unlike filepath.WalkDir, WalkSkip follows symbolic links +// (while guarding against cycles). func WalkSkip(roots []Root, add func(root Root, dir string), skip func(root Root, dir string) bool, opts Options) { for _, root := range roots { walkDir(root, add, skip, opts) @@ -68,34 +80,51 @@ func WalkSkip(roots []Root, add func(root Root, dir string), skip func(root Root // walkDir creates a walker and starts fastwalk with this walker. func walkDir(root Root, add func(Root, string), skip func(root Root, dir string) bool, opts Options) { + if opts.Logf == nil { + opts.Logf = func(format string, args ...interface{}) {} + } if _, err := os.Stat(root.Path); os.IsNotExist(err) { - if opts.Logf != nil { - opts.Logf("skipping nonexistent directory: %v", root.Path) - } + opts.Logf("skipping nonexistent directory: %v", root.Path) return } start := time.Now() - if opts.Logf != nil { - opts.Logf("scanning %s", root.Path) + opts.Logf("scanning %s", root.Path) + + concurrency := opts.Concurrency + if concurrency == 0 { + // The walk be either CPU-bound or I/O-bound, depending on what the + // caller-supplied add function does and the details of the user's platform + // and machine. Rather than trying to fine-tune the concurrency level for a + // specific environment, we default to GOMAXPROCS: it is likely to be a good + // choice for a CPU-bound add function, and if it is instead I/O-bound, then + // dealing with I/O saturation is arguably the job of the kernel and/or + // runtime. (Oversaturating I/O seems unlikely to harm performance as badly + // as failing to saturate would.) + concurrency = runtime.GOMAXPROCS(0) } w := &walker{ root: root, add: add, skip: skip, opts: opts, + sem: make(chan struct{}, concurrency), } w.init() - if err := fastwalk.Walk(root.Path, w.walk); err != nil { - logf := opts.Logf - if logf == nil { - logf = log.Printf - } - logf("scanning directory %v: %v", root.Path, err) - } - if opts.Logf != nil { - opts.Logf("scanned %s in %v", root.Path, time.Since(start)) + w.sem <- struct{}{} + path := root.Path + if path == "" { + path = "." } + if fi, err := os.Lstat(path); err == nil { + w.walk(path, nil, fs.FileInfoToDirEntry(fi)) + } else { + w.opts.Logf("scanning directory %v: %v", root.Path, err) + } + <-w.sem + w.walking.Wait() + + opts.Logf("scanned %s in %v", root.Path, time.Since(start)) } // walker is the callback for fastwalk.Walk. @@ -105,7 +134,18 @@ type walker struct { skip func(Root, string) bool // The callback that will be invoked for every dir. dir is skipped if it returns true. opts Options // Options passed to Walk by the user. - ignoredDirs []os.FileInfo // The ignored directories, loaded from .goimportsignore files. + walking sync.WaitGroup + sem chan struct{} // Channel of semaphore tokens; send to acquire, receive to release. + ignoredDirs []string + + added sync.Map // map[string]bool +} + +// A symlinkList is a linked list of os.FileInfos for parent directories +// reached via symlinks. +type symlinkList struct { + info os.FileInfo + prev *symlinkList } // init initializes the walker based on its Options @@ -121,14 +161,8 @@ func (w *walker) init() { for _, p := range ignoredPaths { full := filepath.Join(w.root.Path, p) - if fi, err := os.Stat(full); err == nil { - w.ignoredDirs = append(w.ignoredDirs, fi) - if w.opts.Logf != nil { - w.opts.Logf("Directory added to ignore list: %s", full) - } - } else if w.opts.Logf != nil { - w.opts.Logf("Error statting ignored directory: %v", err) - } + w.ignoredDirs = append(w.ignoredDirs, full) + w.opts.Logf("Directory added to ignore list: %s", full) } } @@ -138,12 +172,10 @@ func (w *walker) init() { func (w *walker) getIgnoredDirs(path string) []string { file := filepath.Join(path, ".goimportsignore") slurp, err := os.ReadFile(file) - if w.opts.Logf != nil { - if err != nil { - w.opts.Logf("%v", err) - } else { - w.opts.Logf("Read %s", file) - } + if err != nil { + w.opts.Logf("%v", err) + } else { + w.opts.Logf("Read %s", file) } if err != nil { return nil @@ -162,9 +194,9 @@ func (w *walker) getIgnoredDirs(path string) []string { } // shouldSkipDir reports whether the file should be skipped or not. -func (w *walker) shouldSkipDir(fi os.FileInfo, dir string) bool { +func (w *walker) shouldSkipDir(dir string) bool { for _, ignoredDir := range w.ignoredDirs { - if os.SameFile(fi, ignoredDir) { + if dir == ignoredDir { return true } } @@ -176,85 +208,130 @@ func (w *walker) shouldSkipDir(fi os.FileInfo, dir string) bool { } // walk walks through the given path. -func (w *walker) walk(path string, typ os.FileMode) error { - if typ.IsRegular() { - dir := filepath.Dir(path) - if dir == w.root.Path && (w.root.Type == RootGOROOT || w.root.Type == RootGOPATH) { - // Doesn't make sense to have regular files - // directly in your $GOPATH/src or $GOROOT/src. - return fastwalk.ErrSkipFiles - } - if !strings.HasSuffix(path, ".go") { - return nil +// +// Errors are logged if w.opts.Logf is non-nil, but otherwise ignored. +func (w *walker) walk(path string, pathSymlinks *symlinkList, d fs.DirEntry) { + if d.Type()&os.ModeSymlink != 0 { + // Walk the symlink's target rather than the symlink itself. + // + // (Note that os.Stat, unlike the lower-lever os.Readlink, + // follows arbitrarily many layers of symlinks, so it will eventually + // reach either a non-symlink or a nonexistent target.) + // + // TODO(bcmills): 'go list all' itself ignores symlinks within GOROOT/src + // and GOPATH/src. Do we really need to traverse them here? If so, why? + + fi, err := os.Stat(path) + if err != nil { + w.opts.Logf("%v", err) + return } - w.add(w.root, dir) - return fastwalk.ErrSkipFiles - } - if typ == os.ModeDir { - base := filepath.Base(path) - if base == "" || base[0] == '.' || base[0] == '_' || - base == "testdata" || - (w.root.Type == RootGOROOT && w.opts.ModulesEnabled && base == "vendor") || - (!w.opts.ModulesEnabled && base == "node_modules") { - return filepath.SkipDir + // Avoid walking symlink cycles: if we have already followed a symlink to + // this directory as a parent of itself, don't follow it again. + // + // This doesn't catch the first time through a cycle, but it also minimizes + // the number of extra stat calls we make if we *don't* encounter a cycle. + // Since we don't actually expect to encounter symlink cycles in practice, + // this seems like the right tradeoff. + for parent := pathSymlinks; parent != nil; parent = parent.prev { + if os.SameFile(fi, parent.info) { + return + } } - fi, err := os.Lstat(path) - if err == nil && w.shouldSkipDir(fi, path) { - return filepath.SkipDir + + pathSymlinks = &symlinkList{ + info: fi, + prev: pathSymlinks, } - return nil + d = fs.FileInfoToDirEntry(fi) } - if typ == os.ModeSymlink { - base := filepath.Base(path) - if strings.HasPrefix(base, ".#") { - // Emacs noise. - return nil + + if d.Type().IsRegular() { + if !strings.HasSuffix(path, ".go") { + return } - if w.shouldTraverse(path) { - return fastwalk.ErrTraverseLink + + dir := filepath.Dir(path) + if dir == w.root.Path && (w.root.Type == RootGOROOT || w.root.Type == RootGOPATH) { + // Doesn't make sense to have regular files + // directly in your $GOPATH/src or $GOROOT/src. + // + // TODO(bcmills): there are many levels of directory within + // RootModuleCache where this also wouldn't make sense, + // Can we generalize this to any directory without a corresponding + // import path? + return } - } - return nil -} -// shouldTraverse reports whether the symlink fi, found in dir, -// should be followed. It makes sure symlinks were never visited -// before to avoid symlink loops. -func (w *walker) shouldTraverse(path string) bool { - ts, err := os.Stat(path) - if err != nil { - logf := w.opts.Logf - if logf == nil { - logf = log.Printf + if _, dup := w.added.LoadOrStore(dir, true); !dup { + w.add(w.root, dir) } - logf("%v", err) - return false } - if !ts.IsDir() { - return false + + if !d.IsDir() { + return + } + + base := filepath.Base(path) + if base == "" || base[0] == '.' || base[0] == '_' || + base == "testdata" || + (w.root.Type == RootGOROOT && w.opts.ModulesEnabled && base == "vendor") || + (!w.opts.ModulesEnabled && base == "node_modules") || + w.shouldSkipDir(path) { + return } - if w.shouldSkipDir(ts, filepath.Dir(path)) { - return false + + // Read the directory and walk its entries. + + f, err := os.Open(path) + if err != nil { + w.opts.Logf("%v", err) + return } - // Check for symlink loops by statting each directory component - // and seeing if any are the same file as ts. + defer f.Close() + for { - parent := filepath.Dir(path) - if parent == path { - // Made it to the root without seeing a cycle. - // Use this symlink. - return true - } - parentInfo, err := os.Stat(parent) + // We impose an arbitrary limit on the number of ReadDir results per + // directory to limit the amount of memory consumed for stale or upcoming + // directory entries. The limit trades off CPU (number of syscalls to read + // the whole directory) against RAM (reachable directory entries other than + // the one currently being processed). + // + // Since we process the directories recursively, we will end up maintaining + // a slice of entries for each level of the directory tree. + // (Compare https://go.dev/issue/36197.) + ents, err := f.ReadDir(1024) if err != nil { - return false + if err != io.EOF { + w.opts.Logf("%v", err) + } + break } - if os.SameFile(ts, parentInfo) { - // Cycle. Don't traverse. - return false + + for _, d := range ents { + nextPath := filepath.Join(path, d.Name()) + if d.IsDir() { + select { + case w.sem <- struct{}{}: + // Got a new semaphore token, so we can traverse the directory concurrently. + d := d + w.walking.Add(1) + go func() { + defer func() { + <-w.sem + w.walking.Done() + }() + w.walk(nextPath, pathSymlinks, d) + }() + continue + + default: + // No tokens available, so traverse serially. + } + } + + w.walk(nextPath, pathSymlinks, d) } - path = parent } - } diff --git a/vendor/golang.org/x/tools/internal/imports/fix.go b/vendor/golang.org/x/tools/internal/imports/fix.go index d4f1b4e8a0f2..6a18f63a44dc 100644 --- a/vendor/golang.org/x/tools/internal/imports/fix.go +++ b/vendor/golang.org/x/tools/internal/imports/fix.go @@ -13,6 +13,8 @@ import ( "go/build" "go/parser" "go/token" + "go/types" + "io/fs" "io/ioutil" "os" "path" @@ -107,7 +109,7 @@ func parseOtherFiles(fset *token.FileSet, srcDir, filename string) []*ast.File { considerTests := strings.HasSuffix(filename, "_test.go") fileBase := filepath.Base(filename) - packageFileInfos, err := ioutil.ReadDir(srcDir) + packageFileInfos, err := os.ReadDir(srcDir) if err != nil { return nil } @@ -253,7 +255,7 @@ type pass struct { otherFiles []*ast.File // sibling files. // Intermediate state, generated by load. - existingImports map[string]*ImportInfo + existingImports map[string][]*ImportInfo allRefs references missingRefs references @@ -318,7 +320,7 @@ func (p *pass) importIdentifier(imp *ImportInfo) string { func (p *pass) load() ([]*ImportFix, bool) { p.knownPackages = map[string]*packageInfo{} p.missingRefs = references{} - p.existingImports = map[string]*ImportInfo{} + p.existingImports = map[string][]*ImportInfo{} // Load basic information about the file in question. p.allRefs = collectReferences(p.f) @@ -349,7 +351,7 @@ func (p *pass) load() ([]*ImportFix, bool) { } } for _, imp := range imports { - p.existingImports[p.importIdentifier(imp)] = imp + p.existingImports[p.importIdentifier(imp)] = append(p.existingImports[p.importIdentifier(imp)], imp) } // Find missing references. @@ -388,31 +390,33 @@ func (p *pass) fix() ([]*ImportFix, bool) { // Found everything, or giving up. Add the new imports and remove any unused. var fixes []*ImportFix - for _, imp := range p.existingImports { - // We deliberately ignore globals here, because we can't be sure - // they're in the same package. People do things like put multiple - // main packages in the same directory, and we don't want to - // remove imports if they happen to have the same name as a var in - // a different package. - if _, ok := p.allRefs[p.importIdentifier(imp)]; !ok { - fixes = append(fixes, &ImportFix{ - StmtInfo: *imp, - IdentName: p.importIdentifier(imp), - FixType: DeleteImport, - }) - continue - } + for _, identifierImports := range p.existingImports { + for _, imp := range identifierImports { + // We deliberately ignore globals here, because we can't be sure + // they're in the same package. People do things like put multiple + // main packages in the same directory, and we don't want to + // remove imports if they happen to have the same name as a var in + // a different package. + if _, ok := p.allRefs[p.importIdentifier(imp)]; !ok { + fixes = append(fixes, &ImportFix{ + StmtInfo: *imp, + IdentName: p.importIdentifier(imp), + FixType: DeleteImport, + }) + continue + } - // An existing import may need to update its import name to be correct. - if name := p.importSpecName(imp); name != imp.Name { - fixes = append(fixes, &ImportFix{ - StmtInfo: ImportInfo{ - Name: name, - ImportPath: imp.ImportPath, - }, - IdentName: p.importIdentifier(imp), - FixType: SetImportName, - }) + // An existing import may need to update its import name to be correct. + if name := p.importSpecName(imp); name != imp.Name { + fixes = append(fixes, &ImportFix{ + StmtInfo: ImportInfo{ + Name: name, + ImportPath: imp.ImportPath, + }, + IdentName: p.importIdentifier(imp), + FixType: SetImportName, + }) + } } } // Collecting fixes involved map iteration, so sort for stability. See @@ -697,20 +701,21 @@ func ScoreImportPaths(ctx context.Context, env *ProcessEnv, paths []string) (map return result, nil } -func PrimeCache(ctx context.Context, env *ProcessEnv) error { +func PrimeCache(ctx context.Context, resolver Resolver) error { // Fully scan the disk for directories, but don't actually read any Go files. callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true + rootFound: func(root gopathwalk.Root) bool { + // See getCandidatePkgs: walking GOROOT is apparently expensive and + // unnecessary. + return root.Type != gopathwalk.RootGOROOT }, dirFound: func(pkg *pkg) bool { return false }, - packageNameLoaded: func(pkg *pkg) bool { - return false - }, + // packageNameLoaded and exportsLoaded must never be called. } - return getCandidatePkgs(ctx, callback, "", "", env) + + return resolver.scan(ctx, callback) } func candidateImportName(pkg *pkg) string { @@ -824,16 +829,45 @@ func GetPackageExports(ctx context.Context, wrapped func(PackageExport), searchP return getCandidatePkgs(ctx, callback, filename, filePkg, env) } -var requiredGoEnvVars = []string{"GO111MODULE", "GOFLAGS", "GOINSECURE", "GOMOD", "GOMODCACHE", "GONOPROXY", "GONOSUMDB", "GOPATH", "GOPROXY", "GOROOT", "GOSUMDB", "GOWORK"} +// TODO(rfindley): we should depend on GOOS and GOARCH, to provide accurate +// imports when doing cross-platform development. +var requiredGoEnvVars = []string{ + "GO111MODULE", + "GOFLAGS", + "GOINSECURE", + "GOMOD", + "GOMODCACHE", + "GONOPROXY", + "GONOSUMDB", + "GOPATH", + "GOPROXY", + "GOROOT", + "GOSUMDB", + "GOWORK", +} // ProcessEnv contains environment variables and settings that affect the use of // the go command, the go/build package, etc. +// +// ...a ProcessEnv *also* overwrites its Env along with derived state in the +// form of the resolver. And because it is lazily initialized, an env may just +// be broken and unusable, but there is no way for the caller to detect that: +// all queries will just fail. +// +// TODO(rfindley): refactor this package so that this type (perhaps renamed to +// just Env or Config) is an immutable configuration struct, to be exchanged +// for an initialized object via a constructor that returns an error. Perhaps +// the signature should be `func NewResolver(*Env) (*Resolver, error)`, where +// resolver is a concrete type used for resolving imports. Via this +// refactoring, we can avoid the need to call ProcessEnv.init and +// ProcessEnv.GoEnv everywhere, and implicitly fix all the places where this +// these are misused. Also, we'd delegate the caller the decision of how to +// handle a broken environment. type ProcessEnv struct { GocmdRunner *gocommand.Runner BuildFlags []string ModFlag string - ModFile string // SkipPathInScan returns true if the path should be skipped from scans of // the RootCurrentModule root type. The function argument is a clean, @@ -843,7 +877,7 @@ type ProcessEnv struct { // Env overrides the OS environment, and can be used to specify // GOPROXY, GO111MODULE, etc. PATH cannot be set here, because // exec.Command will not honor it. - // Specifying all of RequiredGoEnvVars avoids a call to `go env`. + // Specifying all of requiredGoEnvVars avoids a call to `go env`. Env map[string]string WorkingDir string @@ -851,9 +885,17 @@ type ProcessEnv struct { // If Logf is non-nil, debug logging is enabled through this function. Logf func(format string, args ...interface{}) - initialized bool + // If set, ModCache holds a shared cache of directory info to use across + // multiple ProcessEnvs. + ModCache *DirInfoCache + + initialized bool // see TODO above - resolver Resolver + // resolver and resolverErr are lazily evaluated (see GetResolver). + // This is unclean, but see the big TODO in the docstring for ProcessEnv + // above: for now, we can't be sure that the ProcessEnv is fully initialized. + resolver Resolver + resolverErr error } func (e *ProcessEnv) goEnv() (map[string]string, error) { @@ -933,20 +975,31 @@ func (e *ProcessEnv) env() []string { } func (e *ProcessEnv) GetResolver() (Resolver, error) { - if e.resolver != nil { - return e.resolver, nil - } if err := e.init(); err != nil { return nil, err } - if len(e.Env["GOMOD"]) == 0 && len(e.Env["GOWORK"]) == 0 { - e.resolver = newGopathResolver(e) - return e.resolver, nil + + if e.resolver == nil && e.resolverErr == nil { + // TODO(rfindley): we should only use a gopathResolver here if the working + // directory is actually *in* GOPATH. (I seem to recall an open gopls issue + // for this behavior, but I can't find it). + // + // For gopls, we can optionally explicitly choose a resolver type, since we + // already know the view type. + if len(e.Env["GOMOD"]) == 0 && len(e.Env["GOWORK"]) == 0 { + e.resolver = newGopathResolver(e) + } else { + e.resolver, e.resolverErr = newModuleResolver(e, e.ModCache) + } } - e.resolver = newModuleResolver(e) - return e.resolver, nil + + return e.resolver, e.resolverErr } +// buildContext returns the build.Context to use for matching files. +// +// TODO(rfindley): support dynamic GOOS, GOARCH here, when doing cross-platform +// development. func (e *ProcessEnv) buildContext() (*build.Context, error) { ctx := build.Default goenv, err := e.goEnv() @@ -1026,15 +1079,23 @@ func addStdlibCandidates(pass *pass, refs references) error { type Resolver interface { // loadPackageNames loads the package names in importPaths. loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) + // scan works with callback to search for packages. See scanCallback for details. scan(ctx context.Context, callback *scanCallback) error + // loadExports returns the set of exported symbols in the package at dir. // loadExports may be called concurrently. loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) + // scoreImportPath returns the relevance for an import path. scoreImportPath(ctx context.Context, path string) float64 - ClearForNewScan() + // ClearForNewScan returns a new Resolver based on the receiver that has + // cleared its internal caches of directory contents. + // + // The new resolver should be primed and then set via + // [ProcessEnv.UpdateResolver]. + ClearForNewScan() Resolver } // A scanCallback controls a call to scan and receives its results. @@ -1117,7 +1178,7 @@ func addExternalCandidates(ctx context.Context, pass *pass, refs references, fil go func(pkgName string, symbols map[string]bool) { defer wg.Done() - found, err := findImport(ctx, pass, found[pkgName], pkgName, symbols, filename) + found, err := findImport(ctx, pass, found[pkgName], pkgName, symbols) if err != nil { firstErrOnce.Do(func() { @@ -1148,6 +1209,17 @@ func addExternalCandidates(ctx context.Context, pass *pass, refs references, fil }() for result := range results { + // Don't offer completions that would shadow predeclared + // names, such as github.com/coreos/etcd/error. + if types.Universe.Lookup(result.pkg.name) != nil { // predeclared + // Ideally we would skip this candidate only + // if the predeclared name is actually + // referenced by the file, but that's a lot + // trickier to compute and would still create + // an import that is likely to surprise the + // user before long. + continue + } pass.addCandidate(result.imp, result.pkg) } return firstErr @@ -1190,31 +1262,22 @@ func ImportPathToAssumedName(importPath string) string { type gopathResolver struct { env *ProcessEnv walked bool - cache *dirInfoCache + cache *DirInfoCache scanSema chan struct{} // scanSema prevents concurrent scans. } func newGopathResolver(env *ProcessEnv) *gopathResolver { r := &gopathResolver{ - env: env, - cache: &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - }, + env: env, + cache: NewDirInfoCache(), scanSema: make(chan struct{}, 1), } r.scanSema <- struct{}{} return r } -func (r *gopathResolver) ClearForNewScan() { - <-r.scanSema - r.cache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } - r.walked = false - r.scanSema <- struct{}{} +func (r *gopathResolver) ClearForNewScan() Resolver { + return newGopathResolver(r.env) } func (r *gopathResolver) loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) { @@ -1469,11 +1532,11 @@ func VendorlessPath(ipath string) string { func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, includeTest bool) (string, []string, error) { // Look for non-test, buildable .go files which could provide exports. - all, err := ioutil.ReadDir(dir) + all, err := os.ReadDir(dir) if err != nil { return "", nil, err } - var files []os.FileInfo + var files []fs.DirEntry for _, fi := range all { name := fi.Name() if !strings.HasSuffix(name, ".go") || (!includeTest && strings.HasSuffix(name, "_test.go")) { @@ -1535,7 +1598,7 @@ func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, incl // findImport searches for a package with the given symbols. // If no package is found, findImport returns ("", false, nil) -func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgName string, symbols map[string]bool, filename string) (*pkg, error) { +func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgName string, symbols map[string]bool) (*pkg, error) { // Sort the candidates by their import package length, // assuming that shorter package names are better than long // ones. Note that this sorts by the de-vendored name, so diff --git a/vendor/golang.org/x/tools/internal/imports/imports.go b/vendor/golang.org/x/tools/internal/imports/imports.go index 58e637b90f24..660407548e5a 100644 --- a/vendor/golang.org/x/tools/internal/imports/imports.go +++ b/vendor/golang.org/x/tools/internal/imports/imports.go @@ -236,7 +236,7 @@ func parse(fset *token.FileSet, filename string, src []byte, opt *Options) (*ast src = src[:len(src)-len("}\n")] // Gofmt has also indented the function body one level. // Remove that indent. - src = bytes.Replace(src, []byte("\n\t"), []byte("\n"), -1) + src = bytes.ReplaceAll(src, []byte("\n\t"), []byte("\n")) return matchSpace(orig, src) } return file, adjust, nil diff --git a/vendor/golang.org/x/tools/internal/imports/mod.go b/vendor/golang.org/x/tools/internal/imports/mod.go index 977d2389da12..3d0f38f6c231 100644 --- a/vendor/golang.org/x/tools/internal/imports/mod.go +++ b/vendor/golang.org/x/tools/internal/imports/mod.go @@ -9,7 +9,6 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" "os" "path" "path/filepath" @@ -24,49 +23,88 @@ import ( "golang.org/x/tools/internal/gopathwalk" ) -// ModuleResolver implements resolver for modules using the go command as little -// as feasible. +// Notes(rfindley): ModuleResolver appears to be heavily optimized for scanning +// as fast as possible, which is desirable for a call to goimports from the +// command line, but it doesn't work as well for gopls, where it suffers from +// slow startup (golang/go#44863) and intermittent hanging (golang/go#59216), +// both caused by populating the cache, albeit in slightly different ways. +// +// A high level list of TODOs: +// - Optimize the scan itself, as there is some redundancy statting and +// reading go.mod files. +// - Invert the relationship between ProcessEnv and Resolver (see the +// docstring of ProcessEnv). +// - Make it easier to use an external resolver implementation. +// +// Smaller TODOs are annotated in the code below. + +// ModuleResolver implements the Resolver interface for a workspace using +// modules. +// +// A goal of the ModuleResolver is to invoke the Go command as little as +// possible. To this end, it runs the Go command only for listing module +// information (i.e. `go list -m -e -json ...`). Package scanning, the process +// of loading package information for the modules, is implemented internally +// via the scan method. +// +// It has two types of state: the state derived from the go command, which +// is populated by init, and the state derived from scans, which is populated +// via scan. A root is considered scanned if it has been walked to discover +// directories. However, if the scan did not require additional information +// from the directory (such as package name or exports), the directory +// information itself may be partially populated. It will be lazily filled in +// as needed by scans, using the scanCallback. type ModuleResolver struct { - env *ProcessEnv - moduleCacheDir string - dummyVendorMod *gocommand.ModuleJSON // If vendoring is enabled, the pseudo-module that represents the /vendor directory. - roots []gopathwalk.Root - scanSema chan struct{} // scanSema prevents concurrent scans and guards scannedRoots. - scannedRoots map[gopathwalk.Root]bool - - initialized bool - mains []*gocommand.ModuleJSON - mainByDir map[string]*gocommand.ModuleJSON - modsByModPath []*gocommand.ModuleJSON // All modules, ordered by # of path components in module Path... - modsByDir []*gocommand.ModuleJSON // ...or number of path components in their Dir. - - // moduleCacheCache stores information about the module cache. - moduleCacheCache *dirInfoCache - otherCache *dirInfoCache + env *ProcessEnv + + // Module state, populated during construction + dummyVendorMod *gocommand.ModuleJSON // if vendoring is enabled, a pseudo-module to represent the /vendor directory + moduleCacheDir string // GOMODCACHE, inferred from GOPATH if unset + roots []gopathwalk.Root // roots to scan, in approximate order of importance + mains []*gocommand.ModuleJSON // main modules + mainByDir map[string]*gocommand.ModuleJSON // module information by dir, to join with roots + modsByModPath []*gocommand.ModuleJSON // all modules, ordered by # of path components in their module path + modsByDir []*gocommand.ModuleJSON // ...or by the number of path components in their Dir. + + // Scanning state, populated by scan + + // scanSema prevents concurrent scans, and guards scannedRoots and the cache + // fields below (though the caches themselves are concurrency safe). + // Receive to acquire, send to release. + scanSema chan struct{} + scannedRoots map[gopathwalk.Root]bool // if true, root has been walked + + // Caches of directory info, populated by scans and scan callbacks + // + // moduleCacheCache stores cached information about roots in the module + // cache, which are immutable and therefore do not need to be invalidated. + // + // otherCache stores information about all other roots (even GOROOT), which + // may change. + moduleCacheCache *DirInfoCache + otherCache *DirInfoCache } -func newModuleResolver(e *ProcessEnv) *ModuleResolver { +// newModuleResolver returns a new module-aware goimports resolver. +// +// Note: use caution when modifying this constructor: changes must also be +// reflected in ModuleResolver.ClearForNewScan. +func newModuleResolver(e *ProcessEnv, moduleCacheCache *DirInfoCache) (*ModuleResolver, error) { r := &ModuleResolver{ env: e, scanSema: make(chan struct{}, 1), } - r.scanSema <- struct{}{} - return r -} - -func (r *ModuleResolver) init() error { - if r.initialized { - return nil - } + r.scanSema <- struct{}{} // release goenv, err := r.env.goEnv() if err != nil { - return err + return nil, err } + + // TODO(rfindley): can we refactor to share logic with r.env.invokeGo? inv := gocommand.Invocation{ BuildFlags: r.env.BuildFlags, ModFlag: r.env.ModFlag, - ModFile: r.env.ModFile, Env: r.env.env(), Logf: r.env.Logf, WorkingDir: r.env.WorkingDir, @@ -78,9 +116,12 @@ func (r *ModuleResolver) init() error { // Module vendor directories are ignored in workspace mode: // https://go.googlesource.com/proposal/+/master/design/45713-workspace.md if len(r.env.Env["GOWORK"]) == 0 { + // TODO(rfindley): VendorEnabled runs the go command to get GOFLAGS, but + // they should be available from the ProcessEnv. Can we avoid the redundant + // invocation? vendorEnabled, mainModVendor, err = gocommand.VendorEnabled(context.TODO(), inv, r.env.GocmdRunner) if err != nil { - return err + return nil, err } } @@ -101,19 +142,14 @@ func (r *ModuleResolver) init() error { // GO111MODULE=on. Other errors are fatal. if err != nil { if errMsg := err.Error(); !strings.Contains(errMsg, "working directory is not part of a module") && !strings.Contains(errMsg, "go.mod file not found") { - return err + return nil, err } } } - if gmc := r.env.Env["GOMODCACHE"]; gmc != "" { - r.moduleCacheDir = gmc - } else { - gopaths := filepath.SplitList(goenv["GOPATH"]) - if len(gopaths) == 0 { - return fmt.Errorf("empty GOPATH") - } - r.moduleCacheDir = filepath.Join(gopaths[0], "/pkg/mod") + r.moduleCacheDir = gomodcacheForEnv(goenv) + if r.moduleCacheDir == "" { + return nil, fmt.Errorf("cannot resolve GOMODCACHE") } sort.Slice(r.modsByModPath, func(i, j int) bool { @@ -142,7 +178,11 @@ func (r *ModuleResolver) init() error { } else { addDep := func(mod *gocommand.ModuleJSON) { if mod.Replace == nil { - // This is redundant with the cache, but we'll skip it cheaply enough. + // This is redundant with the cache, but we'll skip it cheaply enough + // when we encounter it in the module cache scan. + // + // Including it at a lower index in r.roots than the module cache dir + // helps prioritize matches from within existing dependencies. r.roots = append(r.roots, gopathwalk.Root{Path: mod.Dir, Type: gopathwalk.RootModuleCache}) } else { r.roots = append(r.roots, gopathwalk.Root{Path: mod.Dir, Type: gopathwalk.RootOther}) @@ -159,24 +199,40 @@ func (r *ModuleResolver) init() error { addDep(mod) } } + // If provided, share the moduleCacheCache. + // + // TODO(rfindley): The module cache is immutable. However, the loaded + // exports do depend on GOOS and GOARCH. Fortunately, the + // ProcessEnv.buildContext does not adjust these from build.DefaultContext + // (even though it should). So for now, this is OK to share, but we need to + // add logic for handling GOOS/GOARCH. + r.moduleCacheCache = moduleCacheCache r.roots = append(r.roots, gopathwalk.Root{Path: r.moduleCacheDir, Type: gopathwalk.RootModuleCache}) } r.scannedRoots = map[gopathwalk.Root]bool{} if r.moduleCacheCache == nil { - r.moduleCacheCache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } - } - if r.otherCache == nil { - r.otherCache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } + r.moduleCacheCache = NewDirInfoCache() } - r.initialized = true - return nil + r.otherCache = NewDirInfoCache() + return r, nil +} + +// gomodcacheForEnv returns the GOMODCACHE value to use based on the given env +// map, which must have GOMODCACHE and GOPATH populated. +// +// TODO(rfindley): this is defensive refactoring. +// 1. Is this even relevant anymore? Can't we just read GOMODCACHE. +// 2. Use this to separate module cache scanning from other scanning. +func gomodcacheForEnv(goenv map[string]string) string { + if gmc := goenv["GOMODCACHE"]; gmc != "" { + return gmc + } + gopaths := filepath.SplitList(goenv["GOPATH"]) + if len(gopaths) == 0 { + return "" + } + return filepath.Join(gopaths[0], "/pkg/mod") } func (r *ModuleResolver) initAllMods() error { @@ -207,30 +263,82 @@ func (r *ModuleResolver) initAllMods() error { return nil } -func (r *ModuleResolver) ClearForNewScan() { - <-r.scanSema - r.scannedRoots = map[gopathwalk.Root]bool{} - r.otherCache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, +// ClearForNewScan invalidates the last scan. +// +// It preserves the set of roots, but forgets about the set of directories. +// Though it forgets the set of module cache directories, it remembers their +// contents, since they are assumed to be immutable. +func (r *ModuleResolver) ClearForNewScan() Resolver { + <-r.scanSema // acquire r, to guard scannedRoots + r2 := &ModuleResolver{ + env: r.env, + dummyVendorMod: r.dummyVendorMod, + moduleCacheDir: r.moduleCacheDir, + roots: r.roots, + mains: r.mains, + mainByDir: r.mainByDir, + modsByModPath: r.modsByModPath, + + scanSema: make(chan struct{}, 1), + scannedRoots: make(map[gopathwalk.Root]bool), + otherCache: NewDirInfoCache(), + moduleCacheCache: r.moduleCacheCache, + } + r2.scanSema <- struct{}{} // r2 must start released + // Invalidate root scans. We don't need to invalidate module cache roots, + // because they are immutable. + // (We don't support a use case where GOMODCACHE is cleaned in the middle of + // e.g. a gopls session: the user must restart gopls to get accurate + // imports.) + // + // Scanning for new directories in GOMODCACHE should be handled elsewhere, + // via a call to ScanModuleCache. + for _, root := range r.roots { + if root.Type == gopathwalk.RootModuleCache && r.scannedRoots[root] { + r2.scannedRoots[root] = true + } } - r.scanSema <- struct{}{} + r.scanSema <- struct{}{} // release r + return r2 } -func (r *ModuleResolver) ClearForNewMod() { - <-r.scanSema - *r = ModuleResolver{ - env: r.env, - moduleCacheCache: r.moduleCacheCache, - otherCache: r.otherCache, - scanSema: r.scanSema, +// ClearModuleInfo invalidates resolver state that depends on go.mod file +// contents (essentially, the output of go list -m -json ...). +// +// Notably, it does not forget directory contents, which are reset +// asynchronously via ClearForNewScan. +// +// If the ProcessEnv is a GOPATH environment, ClearModuleInfo is a no op. +// +// TODO(rfindley): move this to a new env.go, consolidating ProcessEnv methods. +func (e *ProcessEnv) ClearModuleInfo() { + if r, ok := e.resolver.(*ModuleResolver); ok { + resolver, resolverErr := newModuleResolver(e, e.ModCache) + if resolverErr == nil { + <-r.scanSema // acquire (guards caches) + resolver.moduleCacheCache = r.moduleCacheCache + resolver.otherCache = r.otherCache + r.scanSema <- struct{}{} // release + } + e.resolver = resolver + e.resolverErr = resolverErr } - r.init() - r.scanSema <- struct{}{} } -// findPackage returns the module and directory that contains the package at -// the given import path, or returns nil, "" if no module is in scope. +// UpdateResolver sets the resolver for the ProcessEnv to use in imports +// operations. Only for use with the result of [Resolver.ClearForNewScan]. +// +// TODO(rfindley): this awkward API is a result of the (arguably) inverted +// relationship between configuration and state described in the doc comment +// for [ProcessEnv]. +func (e *ProcessEnv) UpdateResolver(r Resolver) { + e.resolver = r + e.resolverErr = nil +} + +// findPackage returns the module and directory from within the main modules +// and their dependencies that contains the package at the given import path, +// or returns nil, "" if no module is in scope. func (r *ModuleResolver) findPackage(importPath string) (*gocommand.ModuleJSON, string) { // This can't find packages in the stdlib, but that's harmless for all // the existing code paths. @@ -265,7 +373,7 @@ func (r *ModuleResolver) findPackage(importPath string) (*gocommand.ModuleJSON, } // Not cached. Read the filesystem. - pkgFiles, err := ioutil.ReadDir(pkgDir) + pkgFiles, err := os.ReadDir(pkgDir) if err != nil { continue } @@ -296,10 +404,6 @@ func (r *ModuleResolver) cacheStore(info directoryPackageInfo) { } } -func (r *ModuleResolver) cacheKeys() []string { - return append(r.moduleCacheCache.Keys(), r.otherCache.Keys()...) -} - // cachePackageName caches the package name for a dir already in the cache. func (r *ModuleResolver) cachePackageName(info directoryPackageInfo) (string, error) { if info.rootType == gopathwalk.RootModuleCache { @@ -368,15 +472,15 @@ func (r *ModuleResolver) dirIsNestedModule(dir string, mod *gocommand.ModuleJSON return modDir != mod.Dir } -func (r *ModuleResolver) modInfo(dir string) (modDir string, modName string) { - readModName := func(modFile string) string { - modBytes, err := ioutil.ReadFile(modFile) - if err != nil { - return "" - } - return modulePath(modBytes) +func readModName(modFile string) string { + modBytes, err := os.ReadFile(modFile) + if err != nil { + return "" } + return modulePath(modBytes) +} +func (r *ModuleResolver) modInfo(dir string) (modDir, modName string) { if r.dirInModuleCache(dir) { if matches := modCacheRegexp.FindStringSubmatch(dir); len(matches) == 3 { index := strings.Index(dir, matches[1]+"@"+matches[2]) @@ -410,11 +514,9 @@ func (r *ModuleResolver) dirInModuleCache(dir string) bool { } func (r *ModuleResolver) loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) { - if err := r.init(); err != nil { - return nil, err - } names := map[string]string{} for _, path := range importPaths { + // TODO(rfindley): shouldn't this use the dirInfoCache? _, packageDir := r.findPackage(path) if packageDir == "" { continue @@ -432,10 +534,6 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error ctx, done := event.Start(ctx, "imports.ModuleResolver.scan") defer done() - if err := r.init(); err != nil { - return err - } - processDir := func(info directoryPackageInfo) { // Skip this directory if we were not able to get the package information successfully. if scanned, err := info.reachedStatus(directoryScanned); !scanned || err != nil { @@ -445,18 +543,18 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error if err != nil { return } - if !callback.dirFound(pkg) { return } + pkg.packageName, err = r.cachePackageName(info) if err != nil { return } - if !callback.packageNameLoaded(pkg) { return } + _, exports, err := r.loadExports(ctx, pkg, false) if err != nil { return @@ -495,7 +593,6 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error return packageScanned } - // Add anything new to the cache, and process it if we're still listening. add := func(root gopathwalk.Root, dir string) { r.cacheStore(r.scanDirForPackage(root, dir)) } @@ -510,9 +607,9 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error select { case <-ctx.Done(): return - case <-r.scanSema: + case <-r.scanSema: // acquire } - defer func() { r.scanSema <- struct{}{} }() + defer func() { r.scanSema <- struct{}{} }() // release // We have the lock on r.scannedRoots, and no other scans can run. for _, root := range roots { if ctx.Err() != nil { @@ -614,9 +711,6 @@ func (r *ModuleResolver) canonicalize(info directoryPackageInfo) (*pkg, error) { } func (r *ModuleResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) { - if err := r.init(); err != nil { - return "", nil, err - } if info, ok := r.cacheLoad(pkg.dir); ok && !includeTest { return r.cacheExports(ctx, r.env, info) } diff --git a/vendor/golang.org/x/tools/internal/imports/mod_cache.go b/vendor/golang.org/x/tools/internal/imports/mod_cache.go index 45690abbb4f1..cfc54657656d 100644 --- a/vendor/golang.org/x/tools/internal/imports/mod_cache.go +++ b/vendor/golang.org/x/tools/internal/imports/mod_cache.go @@ -7,8 +7,12 @@ package imports import ( "context" "fmt" + "path" + "path/filepath" + "strings" "sync" + "golang.org/x/mod/module" "golang.org/x/tools/internal/gopathwalk" ) @@ -39,6 +43,8 @@ const ( exportsLoaded ) +// directoryPackageInfo holds (possibly incomplete) information about packages +// contained in a given directory. type directoryPackageInfo struct { // status indicates the extent to which this struct has been filled in. status directoryPackageStatus @@ -63,7 +69,10 @@ type directoryPackageInfo struct { packageName string // the package name, as declared in the source. // Set when status >= exportsLoaded. - + // TODO(rfindley): it's hard to see this, but exports depend implicitly on + // the default build context GOOS and GOARCH. + // + // We can make this explicit, and key exports by GOOS, GOARCH. exports []string } @@ -79,7 +88,7 @@ func (info *directoryPackageInfo) reachedStatus(target directoryPackageStatus) ( return true, nil } -// dirInfoCache is a concurrency safe map for storing information about +// DirInfoCache is a concurrency-safe map for storing information about // directories that may contain packages. // // The information in this cache is built incrementally. Entries are initialized in scan. @@ -92,21 +101,26 @@ func (info *directoryPackageInfo) reachedStatus(target directoryPackageStatus) ( // The information in the cache is not expected to change for the cache's // lifetime, so there is no protection against competing writes. Users should // take care not to hold the cache across changes to the underlying files. -// -// TODO(suzmue): consider other concurrency strategies and data structures (RWLocks, sync.Map, etc) -type dirInfoCache struct { +type DirInfoCache struct { mu sync.Mutex // dirs stores information about packages in directories, keyed by absolute path. dirs map[string]*directoryPackageInfo listeners map[*int]cacheListener } +func NewDirInfoCache() *DirInfoCache { + return &DirInfoCache{ + dirs: make(map[string]*directoryPackageInfo), + listeners: make(map[*int]cacheListener), + } +} + type cacheListener func(directoryPackageInfo) // ScanAndListen calls listener on all the items in the cache, and on anything // newly added. The returned stop function waits for all in-flight callbacks to // finish and blocks new ones. -func (d *dirInfoCache) ScanAndListen(ctx context.Context, listener cacheListener) func() { +func (d *DirInfoCache) ScanAndListen(ctx context.Context, listener cacheListener) func() { ctx, cancel := context.WithCancel(ctx) // Flushing out all the callbacks is tricky without knowing how many there @@ -162,8 +176,10 @@ func (d *dirInfoCache) ScanAndListen(ctx context.Context, listener cacheListener } // Store stores the package info for dir. -func (d *dirInfoCache) Store(dir string, info directoryPackageInfo) { +func (d *DirInfoCache) Store(dir string, info directoryPackageInfo) { d.mu.Lock() + // TODO(rfindley, golang/go#59216): should we overwrite an existing entry? + // That seems incorrect as the cache should be idempotent. _, old := d.dirs[dir] d.dirs[dir] = &info var listeners []cacheListener @@ -180,7 +196,7 @@ func (d *dirInfoCache) Store(dir string, info directoryPackageInfo) { } // Load returns a copy of the directoryPackageInfo for absolute directory dir. -func (d *dirInfoCache) Load(dir string) (directoryPackageInfo, bool) { +func (d *DirInfoCache) Load(dir string) (directoryPackageInfo, bool) { d.mu.Lock() defer d.mu.Unlock() info, ok := d.dirs[dir] @@ -191,7 +207,7 @@ func (d *dirInfoCache) Load(dir string) (directoryPackageInfo, bool) { } // Keys returns the keys currently present in d. -func (d *dirInfoCache) Keys() (keys []string) { +func (d *DirInfoCache) Keys() (keys []string) { d.mu.Lock() defer d.mu.Unlock() for key := range d.dirs { @@ -200,7 +216,7 @@ func (d *dirInfoCache) Keys() (keys []string) { return keys } -func (d *dirInfoCache) CachePackageName(info directoryPackageInfo) (string, error) { +func (d *DirInfoCache) CachePackageName(info directoryPackageInfo) (string, error) { if loaded, err := info.reachedStatus(nameLoaded); loaded { return info.packageName, err } @@ -213,7 +229,7 @@ func (d *dirInfoCache) CachePackageName(info directoryPackageInfo) (string, erro return info.packageName, info.err } -func (d *dirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { +func (d *DirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { if reached, _ := info.reachedStatus(exportsLoaded); reached { return info.packageName, info.exports, info.err } @@ -234,3 +250,81 @@ func (d *dirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info d d.Store(info.dir, info) return info.packageName, info.exports, info.err } + +// ScanModuleCache walks the given directory, which must be a GOMODCACHE value, +// for directory package information, storing the results in cache. +func ScanModuleCache(dir string, cache *DirInfoCache, logf func(string, ...any)) { + // Note(rfindley): it's hard to see, but this function attempts to implement + // just the side effects on cache of calling PrimeCache with a ProcessEnv + // that has the given dir as its GOMODCACHE. + // + // Teasing out the control flow, we see that we can avoid any handling of + // vendor/ and can infer module info entirely from the path, simplifying the + // logic here. + + root := gopathwalk.Root{ + Path: filepath.Clean(dir), + Type: gopathwalk.RootModuleCache, + } + + directoryInfo := func(root gopathwalk.Root, dir string) directoryPackageInfo { + // This is a copy of ModuleResolver.scanDirForPackage, trimmed down to + // logic that applies to a module cache directory. + + subdir := "" + if dir != root.Path { + subdir = dir[len(root.Path)+len("/"):] + } + + matches := modCacheRegexp.FindStringSubmatch(subdir) + if len(matches) == 0 { + return directoryPackageInfo{ + status: directoryScanned, + err: fmt.Errorf("invalid module cache path: %v", subdir), + } + } + modPath, err := module.UnescapePath(filepath.ToSlash(matches[1])) + if err != nil { + if logf != nil { + logf("decoding module cache path %q: %v", subdir, err) + } + return directoryPackageInfo{ + status: directoryScanned, + err: fmt.Errorf("decoding module cache path %q: %v", subdir, err), + } + } + importPath := path.Join(modPath, filepath.ToSlash(matches[3])) + index := strings.Index(dir, matches[1]+"@"+matches[2]) + modDir := filepath.Join(dir[:index], matches[1]+"@"+matches[2]) + modName := readModName(filepath.Join(modDir, "go.mod")) + return directoryPackageInfo{ + status: directoryScanned, + dir: dir, + rootType: root.Type, + nonCanonicalImportPath: importPath, + moduleDir: modDir, + moduleName: modName, + } + } + + add := func(root gopathwalk.Root, dir string) { + info := directoryInfo(root, dir) + cache.Store(info.dir, info) + } + + skip := func(_ gopathwalk.Root, dir string) bool { + // Skip directories that have already been scanned. + // + // Note that gopathwalk only adds "package" directories, which must contain + // a .go file, and all such package directories in the module cache are + // immutable. So if we can load a dir, it can be skipped. + info, ok := cache.Load(dir) + if !ok { + return false + } + packageScanned, _ := info.reachedStatus(directoryScanned) + return packageScanned + } + + gopathwalk.WalkSkip([]gopathwalk.Root{root}, add, skip, gopathwalk.Options{Logf: logf, ModulesEnabled: true}) +} diff --git a/vendor/golang.org/x/tools/internal/imports/zstdlib.go b/vendor/golang.org/x/tools/internal/imports/zstdlib.go index 9f992c2bec8e..8db24df2ff46 100644 --- a/vendor/golang.org/x/tools/internal/imports/zstdlib.go +++ b/vendor/golang.org/x/tools/internal/imports/zstdlib.go @@ -151,6 +151,7 @@ var stdlib = map[string][]string{ "cmp": { "Compare", "Less", + "Or", "Ordered", }, "compress/bzip2": { @@ -632,6 +633,8 @@ var stdlib = map[string][]string{ "NameMismatch", "NewCertPool", "NotAuthorizedToSign", + "OID", + "OIDFromInts", "PEMCipher", "PEMCipher3DES", "PEMCipherAES128", @@ -706,6 +709,7 @@ var stdlib = map[string][]string{ "LevelWriteCommitted", "Named", "NamedArg", + "Null", "NullBool", "NullByte", "NullFloat64", @@ -1921,6 +1925,7 @@ var stdlib = map[string][]string{ "R_LARCH_32", "R_LARCH_32_PCREL", "R_LARCH_64", + "R_LARCH_64_PCREL", "R_LARCH_ABS64_HI12", "R_LARCH_ABS64_LO20", "R_LARCH_ABS_HI20", @@ -1928,12 +1933,17 @@ var stdlib = map[string][]string{ "R_LARCH_ADD16", "R_LARCH_ADD24", "R_LARCH_ADD32", + "R_LARCH_ADD6", "R_LARCH_ADD64", "R_LARCH_ADD8", + "R_LARCH_ADD_ULEB128", + "R_LARCH_ALIGN", "R_LARCH_B16", "R_LARCH_B21", "R_LARCH_B26", + "R_LARCH_CFA", "R_LARCH_COPY", + "R_LARCH_DELETE", "R_LARCH_GNU_VTENTRY", "R_LARCH_GNU_VTINHERIT", "R_LARCH_GOT64_HI12", @@ -1953,6 +1963,7 @@ var stdlib = map[string][]string{ "R_LARCH_PCALA64_LO20", "R_LARCH_PCALA_HI20", "R_LARCH_PCALA_LO12", + "R_LARCH_PCREL20_S2", "R_LARCH_RELATIVE", "R_LARCH_RELAX", "R_LARCH_SOP_ADD", @@ -1983,8 +1994,10 @@ var stdlib = map[string][]string{ "R_LARCH_SUB16", "R_LARCH_SUB24", "R_LARCH_SUB32", + "R_LARCH_SUB6", "R_LARCH_SUB64", "R_LARCH_SUB8", + "R_LARCH_SUB_ULEB128", "R_LARCH_TLS_DTPMOD32", "R_LARCH_TLS_DTPMOD64", "R_LARCH_TLS_DTPREL32", @@ -2035,6 +2048,7 @@ var stdlib = map[string][]string{ "R_MIPS_LO16", "R_MIPS_NONE", "R_MIPS_PC16", + "R_MIPS_PC32", "R_MIPS_PJUMP", "R_MIPS_REL16", "R_MIPS_REL32", @@ -2952,6 +2966,8 @@ var stdlib = map[string][]string{ "RegisterName", }, "encoding/hex": { + "AppendDecode", + "AppendEncode", "Decode", "DecodeString", "DecodedLen", @@ -3233,6 +3249,7 @@ var stdlib = map[string][]string{ "TypeSpec", "TypeSwitchStmt", "UnaryExpr", + "Unparen", "ValueSpec", "Var", "Visitor", @@ -3492,6 +3509,7 @@ var stdlib = map[string][]string{ "XOR_ASSIGN", }, "go/types": { + "Alias", "ArgumentError", "Array", "AssertableTo", @@ -3559,6 +3577,7 @@ var stdlib = map[string][]string{ "MethodVal", "MissingMethod", "Named", + "NewAlias", "NewArray", "NewChan", "NewChecker", @@ -3627,6 +3646,7 @@ var stdlib = map[string][]string{ "Uint64", "Uint8", "Uintptr", + "Unalias", "Union", "Universe", "Unsafe", @@ -3643,6 +3663,11 @@ var stdlib = map[string][]string{ "WriteSignature", "WriteType", }, + "go/version": { + "Compare", + "IsValid", + "Lang", + }, "hash": { "Hash", "Hash32", @@ -4078,6 +4103,7 @@ var stdlib = map[string][]string{ "NewTextHandler", "Record", "SetDefault", + "SetLogLoggerLevel", "Source", "SourceKey", "String", @@ -4367,6 +4393,35 @@ var stdlib = map[string][]string{ "Uint64", "Zipf", }, + "math/rand/v2": { + "ChaCha8", + "ExpFloat64", + "Float32", + "Float64", + "Int", + "Int32", + "Int32N", + "Int64", + "Int64N", + "IntN", + "N", + "New", + "NewChaCha8", + "NewPCG", + "NewZipf", + "NormFloat64", + "PCG", + "Perm", + "Rand", + "Shuffle", + "Source", + "Uint32", + "Uint32N", + "Uint64", + "Uint64N", + "UintN", + "Zipf", + }, "mime": { "AddExtensionType", "BEncoding", @@ -4540,6 +4595,7 @@ var stdlib = map[string][]string{ "FS", "File", "FileServer", + "FileServerFS", "FileSystem", "Flusher", "Get", @@ -4566,6 +4622,7 @@ var stdlib = map[string][]string{ "MethodPut", "MethodTrace", "NewFileTransport", + "NewFileTransportFS", "NewRequest", "NewRequestWithContext", "NewResponseController", @@ -4599,6 +4656,7 @@ var stdlib = map[string][]string{ "Serve", "ServeContent", "ServeFile", + "ServeFileFS", "ServeMux", "ServeTLS", "Server", @@ -5106,6 +5164,7 @@ var stdlib = map[string][]string{ "StructTag", "Swapper", "Type", + "TypeFor", "TypeOf", "Uint", "Uint16", @@ -5342,6 +5401,7 @@ var stdlib = map[string][]string{ "CompactFunc", "Compare", "CompareFunc", + "Concat", "Contains", "ContainsFunc", "Delete", @@ -10824,6 +10884,7 @@ var stdlib = map[string][]string{ "Value", }, "testing/slogtest": { + "Run", "TestHandler", }, "text/scanner": { diff --git a/vendor/golang.org/x/tools/internal/packagesinternal/packages.go b/vendor/golang.org/x/tools/internal/packagesinternal/packages.go index d9950b1f0bef..44719de173bf 100644 --- a/vendor/golang.org/x/tools/internal/packagesinternal/packages.go +++ b/vendor/golang.org/x/tools/internal/packagesinternal/packages.go @@ -5,10 +5,6 @@ // Package packagesinternal exposes internal-only fields from go/packages. package packagesinternal -import ( - "golang.org/x/tools/internal/gocommand" -) - var GetForTest = func(p interface{}) string { return "" } var GetDepsErrors = func(p interface{}) []*PackageError { return nil } @@ -18,10 +14,6 @@ type PackageError struct { Err string // the error itself } -var GetGoCmdRunner = func(config interface{}) *gocommand.Runner { return nil } - -var SetGoCmdRunner = func(config interface{}, runner *gocommand.Runner) {} - var TypecheckCgo int var DepsErrors int // must be set as a LoadMode to call GetDepsErrors var ForTest int // must be set as a LoadMode to call GetForTest diff --git a/vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go b/vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go index 7e638ec24fcb..ff9437a36cd6 100644 --- a/vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go +++ b/vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go @@ -34,30 +34,16 @@ func GetLines(file *token.File) []int { lines []int _ []struct{} } - type tokenFile118 struct { - _ *token.FileSet // deleted in go1.19 - tokenFile119 - } - - type uP = unsafe.Pointer - switch unsafe.Sizeof(*file) { - case unsafe.Sizeof(tokenFile118{}): - var ptr *tokenFile118 - *(*uP)(uP(&ptr)) = uP(file) - ptr.mu.Lock() - defer ptr.mu.Unlock() - return ptr.lines - case unsafe.Sizeof(tokenFile119{}): - var ptr *tokenFile119 - *(*uP)(uP(&ptr)) = uP(file) - ptr.mu.Lock() - defer ptr.mu.Unlock() - return ptr.lines - - default: + if unsafe.Sizeof(*file) != unsafe.Sizeof(tokenFile119{}) { panic("unexpected token.File size") } + var ptr *tokenFile119 + type uP = unsafe.Pointer + *(*uP)(uP(&ptr)) = uP(file) + ptr.mu.Lock() + defer ptr.mu.Unlock() + return ptr.lines } // AddExistingFiles adds the specified files to the FileSet if they diff --git a/vendor/golang.org/x/tools/internal/typeparams/common.go b/vendor/golang.org/x/tools/internal/typeparams/common.go index d0d0649fe2ac..8c3a42dc3118 100644 --- a/vendor/golang.org/x/tools/internal/typeparams/common.go +++ b/vendor/golang.org/x/tools/internal/typeparams/common.go @@ -2,20 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Package typeparams contains common utilities for writing tools that interact -// with generic Go code, as introduced with Go 1.18. -// -// Many of the types and functions in this package are proxies for the new APIs -// introduced in the standard library with Go 1.18. For example, the -// typeparams.Union type is an alias for go/types.Union, and the ForTypeSpec -// function returns the value of the go/ast.TypeSpec.TypeParams field. At Go -// versions older than 1.18 these helpers are implemented as stubs, allowing -// users of this package to write code that handles generic constructs inline, -// even if the Go version being used to compile does not support generics. -// -// Additionally, this package contains common utilities for working with the -// new generic constructs, to supplement the standard library APIs. Notably, -// the StructuralTerms API computes a minimal representation of the structural +// Package typeparams contains common utilities for writing tools that +// interact with generic Go code, as introduced with Go 1.18. It +// supplements the standard library APIs. Notably, the StructuralTerms +// API computes a minimal representation of the structural // restrictions on a type parameter. // // An external version of these APIs is available in the @@ -27,6 +17,9 @@ import ( "go/ast" "go/token" "go/types" + + "golang.org/x/tools/internal/aliases" + "golang.org/x/tools/internal/typesinternal" ) // UnpackIndexExpr extracts data from AST nodes that represent index @@ -42,7 +35,7 @@ func UnpackIndexExpr(n ast.Node) (x ast.Expr, lbrack token.Pos, indices []ast.Ex switch e := n.(type) { case *ast.IndexExpr: return e.X, e.Lbrack, []ast.Expr{e.Index}, e.Rbrack - case *IndexListExpr: + case *ast.IndexListExpr: return e.X, e.Lbrack, e.Indices, e.Rbrack } return nil, token.NoPos, nil, token.NoPos @@ -63,7 +56,7 @@ func PackIndexExpr(x ast.Expr, lbrack token.Pos, indices []ast.Expr, rbrack toke Rbrack: rbrack, } default: - return &IndexListExpr{ + return &ast.IndexListExpr{ X: x, Lbrack: lbrack, Indices: indices, @@ -72,9 +65,9 @@ func PackIndexExpr(x ast.Expr, lbrack token.Pos, indices []ast.Expr, rbrack toke } } -// IsTypeParam reports whether t is a type parameter. +// IsTypeParam reports whether t is a type parameter (or an alias of one). func IsTypeParam(t types.Type) bool { - _, ok := t.(*TypeParam) + _, ok := aliases.Unalias(t).(*types.TypeParam) return ok } @@ -90,21 +83,16 @@ func OriginMethod(fn *types.Func) *types.Func { if recv == nil { return fn } - base := recv.Type() - p, isPtr := base.(*types.Pointer) - if isPtr { - base = p.Elem() - } - named, isNamed := base.(*types.Named) - if !isNamed { + _, named := typesinternal.ReceiverNamed(recv) + if named == nil { // Receiver is a *types.Interface. return fn } - if ForNamed(named).Len() == 0 { + if named.TypeParams().Len() == 0 { // Receiver base has no type parameters, so we can avoid the lookup below. return fn } - orig := NamedTypeOrigin(named) + orig := named.Origin() gfn, _, _ := types.LookupFieldOrMethod(orig, true, fn.Pkg(), fn.Name()) // This is a fix for a gopls crash (#60628) due to a go/types bug (#60634). In: @@ -157,7 +145,10 @@ func OriginMethod(fn *types.Func) *types.Func { // // In this case, GenericAssignableTo reports that instantiations of Container // are assignable to the corresponding instantiation of Interface. -func GenericAssignableTo(ctxt *Context, V, T types.Type) bool { +func GenericAssignableTo(ctxt *types.Context, V, T types.Type) bool { + V = aliases.Unalias(V) + T = aliases.Unalias(T) + // If V and T are not both named, or do not have matching non-empty type // parameter lists, fall back on types.AssignableTo. @@ -167,9 +158,9 @@ func GenericAssignableTo(ctxt *Context, V, T types.Type) bool { return types.AssignableTo(V, T) } - vtparams := ForNamed(VN) - ttparams := ForNamed(TN) - if vtparams.Len() == 0 || vtparams.Len() != ttparams.Len() || NamedTypeArgs(VN).Len() != 0 || NamedTypeArgs(TN).Len() != 0 { + vtparams := VN.TypeParams() + ttparams := TN.TypeParams() + if vtparams.Len() == 0 || vtparams.Len() != ttparams.Len() || VN.TypeArgs().Len() != 0 || TN.TypeArgs().Len() != 0 { return types.AssignableTo(V, T) } @@ -182,7 +173,7 @@ func GenericAssignableTo(ctxt *Context, V, T types.Type) bool { // Minor optimization: ensure we share a context across the two // instantiations below. if ctxt == nil { - ctxt = NewContext() + ctxt = types.NewContext() } var targs []types.Type @@ -190,12 +181,12 @@ func GenericAssignableTo(ctxt *Context, V, T types.Type) bool { targs = append(targs, vtparams.At(i)) } - vinst, err := Instantiate(ctxt, V, targs, true) + vinst, err := types.Instantiate(ctxt, V, targs, true) if err != nil { panic("type parameters should satisfy their own constraints") } - tinst, err := Instantiate(ctxt, T, targs, true) + tinst, err := types.Instantiate(ctxt, T, targs, true) if err != nil { return false } diff --git a/vendor/golang.org/x/tools/internal/typeparams/coretype.go b/vendor/golang.org/x/tools/internal/typeparams/coretype.go index 71248209ee5e..e66e9d0f48c9 100644 --- a/vendor/golang.org/x/tools/internal/typeparams/coretype.go +++ b/vendor/golang.org/x/tools/internal/typeparams/coretype.go @@ -5,7 +5,10 @@ package typeparams import ( + "fmt" "go/types" + + "golang.org/x/tools/internal/aliases" ) // CoreType returns the core type of T or nil if T does not have a core type. @@ -108,15 +111,27 @@ func CoreType(T types.Type) types.Type { // // _NormalTerms makes no guarantees about the order of terms, except that it // is deterministic. -func _NormalTerms(typ types.Type) ([]*Term, error) { - switch typ := typ.(type) { - case *TypeParam: +func _NormalTerms(typ types.Type) ([]*types.Term, error) { + switch typ := aliases.Unalias(typ).(type) { + case *types.TypeParam: return StructuralTerms(typ) - case *Union: + case *types.Union: return UnionTermSet(typ) case *types.Interface: return InterfaceTermSet(typ) default: - return []*Term{NewTerm(false, typ)}, nil + return []*types.Term{types.NewTerm(false, typ)}, nil + } +} + +// MustDeref returns the type of the variable pointed to by t. +// It panics if t's core type is not a pointer. +// +// TODO(adonovan): ideally this would live in typesinternal, but that +// creates an import cycle. Move there when we melt this package down. +func MustDeref(t types.Type) types.Type { + if ptr, ok := CoreType(t).(*types.Pointer); ok { + return ptr.Elem() } + panic(fmt.Sprintf("%v is not a pointer", t)) } diff --git a/vendor/golang.org/x/tools/internal/typeparams/enabled_go117.go b/vendor/golang.org/x/tools/internal/typeparams/enabled_go117.go deleted file mode 100644 index 18212390e192..000000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/enabled_go117.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.18 -// +build !go1.18 - -package typeparams - -// Enabled reports whether type parameters are enabled in the current build -// environment. -const Enabled = false diff --git a/vendor/golang.org/x/tools/internal/typeparams/enabled_go118.go b/vendor/golang.org/x/tools/internal/typeparams/enabled_go118.go deleted file mode 100644 index d67148823c4d..000000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/enabled_go118.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.18 -// +build go1.18 - -package typeparams - -// Note: this constant is in a separate file as this is the only acceptable -// diff between the <1.18 API of this package and the 1.18 API. - -// Enabled reports whether type parameters are enabled in the current build -// environment. -const Enabled = true diff --git a/vendor/golang.org/x/tools/internal/typeparams/normalize.go b/vendor/golang.org/x/tools/internal/typeparams/normalize.go index 9c631b6512de..93c80fdc96ce 100644 --- a/vendor/golang.org/x/tools/internal/typeparams/normalize.go +++ b/vendor/golang.org/x/tools/internal/typeparams/normalize.go @@ -60,7 +60,7 @@ var ErrEmptyTypeSet = errors.New("empty type set") // // StructuralTerms makes no guarantees about the order of terms, except that it // is deterministic. -func StructuralTerms(tparam *TypeParam) ([]*Term, error) { +func StructuralTerms(tparam *types.TypeParam) ([]*types.Term, error) { constraint := tparam.Constraint() if constraint == nil { return nil, fmt.Errorf("%s has nil constraint", tparam) @@ -78,7 +78,7 @@ func StructuralTerms(tparam *TypeParam) ([]*Term, error) { // // See the documentation of StructuralTerms for more information on // normalization. -func InterfaceTermSet(iface *types.Interface) ([]*Term, error) { +func InterfaceTermSet(iface *types.Interface) ([]*types.Term, error) { return computeTermSet(iface) } @@ -88,11 +88,11 @@ func InterfaceTermSet(iface *types.Interface) ([]*Term, error) { // // See the documentation of StructuralTerms for more information on // normalization. -func UnionTermSet(union *Union) ([]*Term, error) { +func UnionTermSet(union *types.Union) ([]*types.Term, error) { return computeTermSet(union) } -func computeTermSet(typ types.Type) ([]*Term, error) { +func computeTermSet(typ types.Type) ([]*types.Term, error) { tset, err := computeTermSetInternal(typ, make(map[types.Type]*termSet), 0) if err != nil { return nil, err @@ -103,9 +103,9 @@ func computeTermSet(typ types.Type) ([]*Term, error) { if tset.terms.isAll() { return nil, nil } - var terms []*Term + var terms []*types.Term for _, term := range tset.terms { - terms = append(terms, NewTerm(term.tilde, term.typ)) + terms = append(terms, types.NewTerm(term.tilde, term.typ)) } return terms, nil } @@ -162,7 +162,7 @@ func computeTermSetInternal(t types.Type, seen map[types.Type]*termSet, depth in tset.terms = allTermlist for i := 0; i < u.NumEmbeddeds(); i++ { embedded := u.EmbeddedType(i) - if _, ok := embedded.Underlying().(*TypeParam); ok { + if _, ok := embedded.Underlying().(*types.TypeParam); ok { return nil, fmt.Errorf("invalid embedded type %T", embedded) } tset2, err := computeTermSetInternal(embedded, seen, depth+1) @@ -171,7 +171,7 @@ func computeTermSetInternal(t types.Type, seen map[types.Type]*termSet, depth in } tset.terms = tset.terms.intersect(tset2.terms) } - case *Union: + case *types.Union: // The term set of a union is the union of term sets of its terms. tset.terms = nil for i := 0; i < u.Len(); i++ { @@ -184,7 +184,7 @@ func computeTermSetInternal(t types.Type, seen map[types.Type]*termSet, depth in return nil, err } terms = tset2.terms - case *TypeParam, *Union: + case *types.TypeParam, *types.Union: // A stand-alone type parameter or union is not permitted as union // term. return nil, fmt.Errorf("invalid union term %T", t) @@ -199,7 +199,7 @@ func computeTermSetInternal(t types.Type, seen map[types.Type]*termSet, depth in return nil, fmt.Errorf("exceeded max term count %d", maxTermCount) } } - case *TypeParam: + case *types.TypeParam: panic("unreachable") default: // For all other types, the term set is just a single non-tilde term diff --git a/vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go b/vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go deleted file mode 100644 index 7ed86e1711b9..000000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.18 -// +build !go1.18 - -package typeparams - -import ( - "go/ast" - "go/token" - "go/types" -) - -func unsupported() { - panic("type parameters are unsupported at this go version") -} - -// IndexListExpr is a placeholder type, as type parameters are not supported at -// this Go version. Its methods panic on use. -type IndexListExpr struct { - ast.Expr - X ast.Expr // expression - Lbrack token.Pos // position of "[" - Indices []ast.Expr // index expressions - Rbrack token.Pos // position of "]" -} - -// ForTypeSpec returns an empty field list, as type parameters on not supported -// at this Go version. -func ForTypeSpec(*ast.TypeSpec) *ast.FieldList { - return nil -} - -// ForFuncType returns an empty field list, as type parameters are not -// supported at this Go version. -func ForFuncType(*ast.FuncType) *ast.FieldList { - return nil -} - -// TypeParam is a placeholder type, as type parameters are not supported at -// this Go version. Its methods panic on use. -type TypeParam struct{ types.Type } - -func (*TypeParam) Index() int { unsupported(); return 0 } -func (*TypeParam) Constraint() types.Type { unsupported(); return nil } -func (*TypeParam) Obj() *types.TypeName { unsupported(); return nil } - -// TypeParamList is a placeholder for an empty type parameter list. -type TypeParamList struct{} - -func (*TypeParamList) Len() int { return 0 } -func (*TypeParamList) At(int) *TypeParam { unsupported(); return nil } - -// TypeList is a placeholder for an empty type list. -type TypeList struct{} - -func (*TypeList) Len() int { return 0 } -func (*TypeList) At(int) types.Type { unsupported(); return nil } - -// NewTypeParam is unsupported at this Go version, and panics. -func NewTypeParam(name *types.TypeName, constraint types.Type) *TypeParam { - unsupported() - return nil -} - -// SetTypeParamConstraint is unsupported at this Go version, and panics. -func SetTypeParamConstraint(tparam *TypeParam, constraint types.Type) { - unsupported() -} - -// NewSignatureType calls types.NewSignature, panicking if recvTypeParams or -// typeParams is non-empty. -func NewSignatureType(recv *types.Var, recvTypeParams, typeParams []*TypeParam, params, results *types.Tuple, variadic bool) *types.Signature { - if len(recvTypeParams) != 0 || len(typeParams) != 0 { - panic("signatures cannot have type parameters at this Go version") - } - return types.NewSignature(recv, params, results, variadic) -} - -// ForSignature returns an empty slice. -func ForSignature(*types.Signature) *TypeParamList { - return nil -} - -// RecvTypeParams returns a nil slice. -func RecvTypeParams(sig *types.Signature) *TypeParamList { - return nil -} - -// IsComparable returns false, as no interfaces are type-restricted at this Go -// version. -func IsComparable(*types.Interface) bool { - return false -} - -// IsMethodSet returns true, as no interfaces are type-restricted at this Go -// version. -func IsMethodSet(*types.Interface) bool { - return true -} - -// IsImplicit returns false, as no interfaces are implicit at this Go version. -func IsImplicit(*types.Interface) bool { - return false -} - -// MarkImplicit does nothing, because this Go version does not have implicit -// interfaces. -func MarkImplicit(*types.Interface) {} - -// ForNamed returns an empty type parameter list, as type parameters are not -// supported at this Go version. -func ForNamed(*types.Named) *TypeParamList { - return nil -} - -// SetForNamed panics if tparams is non-empty. -func SetForNamed(_ *types.Named, tparams []*TypeParam) { - if len(tparams) > 0 { - unsupported() - } -} - -// NamedTypeArgs returns nil. -func NamedTypeArgs(*types.Named) *TypeList { - return nil -} - -// NamedTypeOrigin is the identity method at this Go version. -func NamedTypeOrigin(named *types.Named) *types.Named { - return named -} - -// Term holds information about a structural type restriction. -type Term struct { - tilde bool - typ types.Type -} - -func (m *Term) Tilde() bool { return m.tilde } -func (m *Term) Type() types.Type { return m.typ } -func (m *Term) String() string { - pre := "" - if m.tilde { - pre = "~" - } - return pre + m.typ.String() -} - -// NewTerm is unsupported at this Go version, and panics. -func NewTerm(tilde bool, typ types.Type) *Term { - return &Term{tilde, typ} -} - -// Union is a placeholder type, as type parameters are not supported at this Go -// version. Its methods panic on use. -type Union struct{ types.Type } - -func (*Union) Len() int { return 0 } -func (*Union) Term(i int) *Term { unsupported(); return nil } - -// NewUnion is unsupported at this Go version, and panics. -func NewUnion(terms []*Term) *Union { - unsupported() - return nil -} - -// InitInstanceInfo is a noop at this Go version. -func InitInstanceInfo(*types.Info) {} - -// Instance is a placeholder type, as type parameters are not supported at this -// Go version. -type Instance struct { - TypeArgs *TypeList - Type types.Type -} - -// GetInstances returns a nil map, as type parameters are not supported at this -// Go version. -func GetInstances(info *types.Info) map[*ast.Ident]Instance { return nil } - -// Context is a placeholder type, as type parameters are not supported at -// this Go version. -type Context struct{} - -// NewContext returns a placeholder Context instance. -func NewContext() *Context { - return &Context{} -} - -// Instantiate is unsupported on this Go version, and panics. -func Instantiate(ctxt *Context, typ types.Type, targs []types.Type, validate bool) (types.Type, error) { - unsupported() - return nil, nil -} diff --git a/vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go b/vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go deleted file mode 100644 index cf301af1dbe8..000000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.18 -// +build go1.18 - -package typeparams - -import ( - "go/ast" - "go/types" -) - -// IndexListExpr is an alias for ast.IndexListExpr. -type IndexListExpr = ast.IndexListExpr - -// ForTypeSpec returns n.TypeParams. -func ForTypeSpec(n *ast.TypeSpec) *ast.FieldList { - if n == nil { - return nil - } - return n.TypeParams -} - -// ForFuncType returns n.TypeParams. -func ForFuncType(n *ast.FuncType) *ast.FieldList { - if n == nil { - return nil - } - return n.TypeParams -} - -// TypeParam is an alias for types.TypeParam -type TypeParam = types.TypeParam - -// TypeParamList is an alias for types.TypeParamList -type TypeParamList = types.TypeParamList - -// TypeList is an alias for types.TypeList -type TypeList = types.TypeList - -// NewTypeParam calls types.NewTypeParam. -func NewTypeParam(name *types.TypeName, constraint types.Type) *TypeParam { - return types.NewTypeParam(name, constraint) -} - -// SetTypeParamConstraint calls tparam.SetConstraint(constraint). -func SetTypeParamConstraint(tparam *TypeParam, constraint types.Type) { - tparam.SetConstraint(constraint) -} - -// NewSignatureType calls types.NewSignatureType. -func NewSignatureType(recv *types.Var, recvTypeParams, typeParams []*TypeParam, params, results *types.Tuple, variadic bool) *types.Signature { - return types.NewSignatureType(recv, recvTypeParams, typeParams, params, results, variadic) -} - -// ForSignature returns sig.TypeParams() -func ForSignature(sig *types.Signature) *TypeParamList { - return sig.TypeParams() -} - -// RecvTypeParams returns sig.RecvTypeParams(). -func RecvTypeParams(sig *types.Signature) *TypeParamList { - return sig.RecvTypeParams() -} - -// IsComparable calls iface.IsComparable(). -func IsComparable(iface *types.Interface) bool { - return iface.IsComparable() -} - -// IsMethodSet calls iface.IsMethodSet(). -func IsMethodSet(iface *types.Interface) bool { - return iface.IsMethodSet() -} - -// IsImplicit calls iface.IsImplicit(). -func IsImplicit(iface *types.Interface) bool { - return iface.IsImplicit() -} - -// MarkImplicit calls iface.MarkImplicit(). -func MarkImplicit(iface *types.Interface) { - iface.MarkImplicit() -} - -// ForNamed extracts the (possibly empty) type parameter object list from -// named. -func ForNamed(named *types.Named) *TypeParamList { - return named.TypeParams() -} - -// SetForNamed sets the type params tparams on n. Each tparam must be of -// dynamic type *types.TypeParam. -func SetForNamed(n *types.Named, tparams []*TypeParam) { - n.SetTypeParams(tparams) -} - -// NamedTypeArgs returns named.TypeArgs(). -func NamedTypeArgs(named *types.Named) *TypeList { - return named.TypeArgs() -} - -// NamedTypeOrigin returns named.Orig(). -func NamedTypeOrigin(named *types.Named) *types.Named { - return named.Origin() -} - -// Term is an alias for types.Term. -type Term = types.Term - -// NewTerm calls types.NewTerm. -func NewTerm(tilde bool, typ types.Type) *Term { - return types.NewTerm(tilde, typ) -} - -// Union is an alias for types.Union -type Union = types.Union - -// NewUnion calls types.NewUnion. -func NewUnion(terms []*Term) *Union { - return types.NewUnion(terms) -} - -// InitInstanceInfo initializes info to record information about type and -// function instances. -func InitInstanceInfo(info *types.Info) { - info.Instances = make(map[*ast.Ident]types.Instance) -} - -// Instance is an alias for types.Instance. -type Instance = types.Instance - -// GetInstances returns info.Instances. -func GetInstances(info *types.Info) map[*ast.Ident]Instance { - return info.Instances -} - -// Context is an alias for types.Context. -type Context = types.Context - -// NewContext calls types.NewContext. -func NewContext() *Context { - return types.NewContext() -} - -// Instantiate calls types.Instantiate. -func Instantiate(ctxt *Context, typ types.Type, targs []types.Type, validate bool) (types.Type, error) { - return types.Instantiate(ctxt, typ, targs, validate) -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/objectpath.go b/vendor/golang.org/x/tools/internal/typesinternal/objectpath.go deleted file mode 100644 index 5e96e8955737..000000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/objectpath.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import "go/types" - -// This file contains back doors that allow gopls to avoid method sorting when -// using the objectpath package. -// -// This is performance-critical in certain repositories, but changing the -// behavior of the objectpath package is still being discussed in -// golang/go#61443. If we decide to remove the sorting in objectpath we can -// simply delete these back doors. Otherwise, we should add a new API to -// objectpath that allows controlling the sorting. - -// SkipEncoderMethodSorting marks enc (which must be an *objectpath.Encoder) as -// not requiring sorted methods. -var SkipEncoderMethodSorting func(enc interface{}) - -// ObjectpathObject is like objectpath.Object, but allows suppressing method -// sorting. -var ObjectpathObject func(pkg *types.Package, p string, skipMethodSorting bool) (types.Object, error) diff --git a/vendor/golang.org/x/tools/internal/typesinternal/recv.go b/vendor/golang.org/x/tools/internal/typesinternal/recv.go new file mode 100644 index 000000000000..fea7c8b75e8e --- /dev/null +++ b/vendor/golang.org/x/tools/internal/typesinternal/recv.go @@ -0,0 +1,43 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package typesinternal + +import ( + "go/types" + + "golang.org/x/tools/internal/aliases" +) + +// ReceiverNamed returns the named type (if any) associated with the +// type of recv, which may be of the form N or *N, or aliases thereof. +// It also reports whether a Pointer was present. +func ReceiverNamed(recv *types.Var) (isPtr bool, named *types.Named) { + t := recv.Type() + if ptr, ok := aliases.Unalias(t).(*types.Pointer); ok { + isPtr = true + t = ptr.Elem() + } + named, _ = aliases.Unalias(t).(*types.Named) + return +} + +// Unpointer returns T given *T or an alias thereof. +// For all other types it is the identity function. +// It does not look at underlying types. +// The result may be an alias. +// +// Use this function to strip off the optional pointer on a receiver +// in a field or method selection, without losing the named type +// (which is needed to compute the method set). +// +// See also [typeparams.MustDeref], which removes one level of +// indirection from the type, regardless of named types (analogous to +// a LOAD instruction). +func Unpointer(t types.Type) types.Type { + if ptr, ok := aliases.Unalias(t).(*types.Pointer); ok { + return ptr.Elem() + } + return t +} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/types_118.go b/vendor/golang.org/x/tools/internal/typesinternal/types_118.go index a42b072a67d3..ef7ea290c0bd 100644 --- a/vendor/golang.org/x/tools/internal/typesinternal/types_118.go +++ b/vendor/golang.org/x/tools/internal/typesinternal/types_118.go @@ -2,9 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.18 -// +build go1.18 - package typesinternal import ( diff --git a/vendor/golang.org/x/tools/internal/versions/features.go b/vendor/golang.org/x/tools/internal/versions/features.go new file mode 100644 index 000000000000..b53f17861613 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/features.go @@ -0,0 +1,43 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package versions + +// This file contains predicates for working with file versions to +// decide when a tool should consider a language feature enabled. + +// GoVersions that features in x/tools can be gated to. +const ( + Go1_18 = "go1.18" + Go1_19 = "go1.19" + Go1_20 = "go1.20" + Go1_21 = "go1.21" + Go1_22 = "go1.22" +) + +// Future is an invalid unknown Go version sometime in the future. +// Do not use directly with Compare. +const Future = "" + +// AtLeast reports whether the file version v comes after a Go release. +// +// Use this predicate to enable a behavior once a certain Go release +// has happened (and stays enabled in the future). +func AtLeast(v, release string) bool { + if v == Future { + return true // an unknown future version is always after y. + } + return Compare(Lang(v), Lang(release)) >= 0 +} + +// Before reports whether the file version v is strictly before a Go release. +// +// Use this predicate to disable a behavior once a certain Go release +// has happened (and stays enabled in the future). +func Before(v, release string) bool { + if v == Future { + return false // an unknown future version happens after y. + } + return Compare(Lang(v), Lang(release)) < 0 +} diff --git a/vendor/golang.org/x/tools/internal/versions/gover.go b/vendor/golang.org/x/tools/internal/versions/gover.go new file mode 100644 index 000000000000..bbabcd22e948 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/gover.go @@ -0,0 +1,172 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This is a fork of internal/gover for use by x/tools until +// go1.21 and earlier are no longer supported by x/tools. + +package versions + +import "strings" + +// A gover is a parsed Go gover: major[.Minor[.Patch]][kind[pre]] +// The numbers are the original decimal strings to avoid integer overflows +// and since there is very little actual math. (Probably overflow doesn't matter in practice, +// but at the time this code was written, there was an existing test that used +// go1.99999999999, which does not fit in an int on 32-bit platforms. +// The "big decimal" representation avoids the problem entirely.) +type gover struct { + major string // decimal + minor string // decimal or "" + patch string // decimal or "" + kind string // "", "alpha", "beta", "rc" + pre string // decimal or "" +} + +// compare returns -1, 0, or +1 depending on whether +// x < y, x == y, or x > y, interpreted as toolchain versions. +// The versions x and y must not begin with a "go" prefix: just "1.21" not "go1.21". +// Malformed versions compare less than well-formed versions and equal to each other. +// The language version "1.21" compares less than the release candidate and eventual releases "1.21rc1" and "1.21.0". +func compare(x, y string) int { + vx := parse(x) + vy := parse(y) + + if c := cmpInt(vx.major, vy.major); c != 0 { + return c + } + if c := cmpInt(vx.minor, vy.minor); c != 0 { + return c + } + if c := cmpInt(vx.patch, vy.patch); c != 0 { + return c + } + if c := strings.Compare(vx.kind, vy.kind); c != 0 { // "" < alpha < beta < rc + return c + } + if c := cmpInt(vx.pre, vy.pre); c != 0 { + return c + } + return 0 +} + +// lang returns the Go language version. For example, lang("1.2.3") == "1.2". +func lang(x string) string { + v := parse(x) + if v.minor == "" || v.major == "1" && v.minor == "0" { + return v.major + } + return v.major + "." + v.minor +} + +// isValid reports whether the version x is valid. +func isValid(x string) bool { + return parse(x) != gover{} +} + +// parse parses the Go version string x into a version. +// It returns the zero version if x is malformed. +func parse(x string) gover { + var v gover + + // Parse major version. + var ok bool + v.major, x, ok = cutInt(x) + if !ok { + return gover{} + } + if x == "" { + // Interpret "1" as "1.0.0". + v.minor = "0" + v.patch = "0" + return v + } + + // Parse . before minor version. + if x[0] != '.' { + return gover{} + } + + // Parse minor version. + v.minor, x, ok = cutInt(x[1:]) + if !ok { + return gover{} + } + if x == "" { + // Patch missing is same as "0" for older versions. + // Starting in Go 1.21, patch missing is different from explicit .0. + if cmpInt(v.minor, "21") < 0 { + v.patch = "0" + } + return v + } + + // Parse patch if present. + if x[0] == '.' { + v.patch, x, ok = cutInt(x[1:]) + if !ok || x != "" { + // Note that we are disallowing prereleases (alpha, beta, rc) for patch releases here (x != ""). + // Allowing them would be a bit confusing because we already have: + // 1.21 < 1.21rc1 + // But a prerelease of a patch would have the opposite effect: + // 1.21.3rc1 < 1.21.3 + // We've never needed them before, so let's not start now. + return gover{} + } + return v + } + + // Parse prerelease. + i := 0 + for i < len(x) && (x[i] < '0' || '9' < x[i]) { + if x[i] < 'a' || 'z' < x[i] { + return gover{} + } + i++ + } + if i == 0 { + return gover{} + } + v.kind, x = x[:i], x[i:] + if x == "" { + return v + } + v.pre, x, ok = cutInt(x) + if !ok || x != "" { + return gover{} + } + + return v +} + +// cutInt scans the leading decimal number at the start of x to an integer +// and returns that value and the rest of the string. +func cutInt(x string) (n, rest string, ok bool) { + i := 0 + for i < len(x) && '0' <= x[i] && x[i] <= '9' { + i++ + } + if i == 0 || x[0] == '0' && i != 1 { // no digits or unnecessary leading zero + return "", "", false + } + return x[:i], x[i:], true +} + +// cmpInt returns cmp.Compare(x, y) interpreting x and y as decimal numbers. +// (Copied from golang.org/x/mod/semver's compareInt.) +func cmpInt(x, y string) int { + if x == y { + return 0 + } + if len(x) < len(y) { + return -1 + } + if len(x) > len(y) { + return +1 + } + if x < y { + return -1 + } else { + return +1 + } +} diff --git a/vendor/golang.org/x/tools/internal/versions/toolchain.go b/vendor/golang.org/x/tools/internal/versions/toolchain.go new file mode 100644 index 000000000000..377bf7a53b4a --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/toolchain.go @@ -0,0 +1,14 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package versions + +// toolchain is maximum version (<1.22) that the go toolchain used +// to build the current tool is known to support. +// +// When a tool is built with >=1.22, the value of toolchain is unused. +// +// x/tools does not support building with go <1.18. So we take this +// as the minimum possible maximum. +var toolchain string = Go1_18 diff --git a/vendor/golang.org/x/tools/internal/versions/toolchain_go119.go b/vendor/golang.org/x/tools/internal/versions/toolchain_go119.go new file mode 100644 index 000000000000..f65beed9d832 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/toolchain_go119.go @@ -0,0 +1,14 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.19 +// +build go1.19 + +package versions + +func init() { + if Compare(toolchain, Go1_19) < 0 { + toolchain = Go1_19 + } +} diff --git a/vendor/golang.org/x/tools/internal/versions/toolchain_go120.go b/vendor/golang.org/x/tools/internal/versions/toolchain_go120.go new file mode 100644 index 000000000000..1a9efa126cdf --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/toolchain_go120.go @@ -0,0 +1,14 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.20 +// +build go1.20 + +package versions + +func init() { + if Compare(toolchain, Go1_20) < 0 { + toolchain = Go1_20 + } +} diff --git a/vendor/golang.org/x/tools/internal/versions/toolchain_go121.go b/vendor/golang.org/x/tools/internal/versions/toolchain_go121.go new file mode 100644 index 000000000000..b7ef216dfecf --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/toolchain_go121.go @@ -0,0 +1,14 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.21 +// +build go1.21 + +package versions + +func init() { + if Compare(toolchain, Go1_21) < 0 { + toolchain = Go1_21 + } +} diff --git a/vendor/golang.org/x/tools/internal/versions/types.go b/vendor/golang.org/x/tools/internal/versions/types.go new file mode 100644 index 000000000000..562eef21fa20 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/types.go @@ -0,0 +1,19 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package versions + +import ( + "go/types" +) + +// GoVersion returns the Go version of the type package. +// It returns zero if no version can be determined. +func GoVersion(pkg *types.Package) string { + // TODO(taking): x/tools can call GoVersion() [from 1.21] after 1.25. + if pkg, ok := any(pkg).(interface{ GoVersion() string }); ok { + return pkg.GoVersion() + } + return "" +} diff --git a/vendor/golang.org/x/tools/internal/versions/types_go121.go b/vendor/golang.org/x/tools/internal/versions/types_go121.go new file mode 100644 index 000000000000..b4345d3349e5 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/types_go121.go @@ -0,0 +1,30 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !go1.22 +// +build !go1.22 + +package versions + +import ( + "go/ast" + "go/types" +) + +// FileVersion returns a language version (<=1.21) derived from runtime.Version() +// or an unknown future version. +func FileVersion(info *types.Info, file *ast.File) string { + // In x/tools built with Go <= 1.21, we do not have Info.FileVersions + // available. We use a go version derived from the toolchain used to + // compile the tool by default. + // This will be <= go1.21. We take this as the maximum version that + // this tool can support. + // + // There are no features currently in x/tools that need to tell fine grained + // differences for versions <1.22. + return toolchain +} + +// InitFileVersions is a noop when compiled with this Go version. +func InitFileVersions(*types.Info) {} diff --git a/vendor/golang.org/x/tools/internal/versions/types_go122.go b/vendor/golang.org/x/tools/internal/versions/types_go122.go new file mode 100644 index 000000000000..e8180632a526 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/types_go122.go @@ -0,0 +1,41 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.22 +// +build go1.22 + +package versions + +import ( + "go/ast" + "go/types" +) + +// FileVersions returns a file's Go version. +// The reported version is an unknown Future version if a +// version cannot be determined. +func FileVersion(info *types.Info, file *ast.File) string { + // In tools built with Go >= 1.22, the Go version of a file + // follow a cascades of sources: + // 1) types.Info.FileVersion, which follows the cascade: + // 1.a) file version (ast.File.GoVersion), + // 1.b) the package version (types.Config.GoVersion), or + // 2) is some unknown Future version. + // + // File versions require a valid package version to be provided to types + // in Config.GoVersion. Config.GoVersion is either from the package's module + // or the toolchain (go run). This value should be provided by go/packages + // or unitchecker.Config.GoVersion. + if v := info.FileVersions[file]; IsValid(v) { + return v + } + // Note: we could instead return runtime.Version() [if valid]. + // This would act as a max version on what a tool can support. + return Future +} + +// InitFileVersions initializes info to record Go versions for Go files. +func InitFileVersions(info *types.Info) { + info.FileVersions = make(map[*ast.File]string) +} diff --git a/vendor/golang.org/x/tools/internal/versions/versions.go b/vendor/golang.org/x/tools/internal/versions/versions.go new file mode 100644 index 000000000000..8d1f7453dbfc --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/versions.go @@ -0,0 +1,57 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package versions + +import ( + "strings" +) + +// Note: If we use build tags to use go/versions when go >=1.22, +// we run into go.dev/issue/53737. Under some operations users would see an +// import of "go/versions" even if they would not compile the file. +// For example, during `go get -u ./...` (go.dev/issue/64490) we do not try to include +// For this reason, this library just a clone of go/versions for the moment. + +// Lang returns the Go language version for version x. +// If x is not a valid version, Lang returns the empty string. +// For example: +// +// Lang("go1.21rc2") = "go1.21" +// Lang("go1.21.2") = "go1.21" +// Lang("go1.21") = "go1.21" +// Lang("go1") = "go1" +// Lang("bad") = "" +// Lang("1.21") = "" +func Lang(x string) string { + v := lang(stripGo(x)) + if v == "" { + return "" + } + return x[:2+len(v)] // "go"+v without allocation +} + +// Compare returns -1, 0, or +1 depending on whether +// x < y, x == y, or x > y, interpreted as Go versions. +// The versions x and y must begin with a "go" prefix: "go1.21" not "1.21". +// Invalid versions, including the empty string, compare less than +// valid versions and equal to each other. +// The language version "go1.21" compares less than the +// release candidate and eventual releases "go1.21rc1" and "go1.21.0". +// Custom toolchain suffixes are ignored during comparison: +// "go1.21.0" and "go1.21.0-bigcorp" are equal. +func Compare(x, y string) int { return compare(stripGo(x), stripGo(y)) } + +// IsValid reports whether the version x is valid. +func IsValid(x string) bool { return isValid(stripGo(x)) } + +// stripGo converts from a "go1.21" version to a "1.21" version. +// If v does not start with "go", stripGo returns the empty string (a known invalid version). +func stripGo(v string) string { + v, _, _ = strings.Cut(v, "-") // strip -bigcorp suffix. + if len(v) < 2 || v[:2] != "go" { + return "" + } + return v[2:] +} diff --git a/vendor/modules.txt b/vendor/modules.txt index a104562891dd..b6e230524c02 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -103,6 +103,8 @@ github.com/davecgh/go-spew/spew # github.com/fatih/color v1.15.0 ## explicit; go 1.17 github.com/fatih/color +# github.com/fsnotify/fsnotify v1.5.4 +## explicit; go 1.16 # github.com/gofrs/uuid v4.4.0+incompatible ## explicit github.com/gofrs/uuid @@ -128,6 +130,8 @@ github.com/google/go-cmp/cmp/internal/value # github.com/google/uuid v1.4.0 ## explicit github.com/google/uuid +# github.com/gookit/color v1.5.1 +## explicit; go 1.14 # github.com/hashicorp/errwrap v1.1.0 ## explicit github.com/hashicorp/errwrap @@ -378,16 +382,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01- github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/scopemaps github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/tokens github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/webhooks -github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01 github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules -github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets -github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/operation -github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/privateendpointconnections -github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/registries -github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/replications -github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/scopemaps -github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/tokens -github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/webhooks github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2019-08-01/containerservices github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-03-02-preview github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-03-02-preview/agentpools @@ -1172,7 +1167,9 @@ github.com/hashicorp/hc-install/product github.com/hashicorp/hc-install/releases github.com/hashicorp/hc-install/src github.com/hashicorp/hc-install/version -# github.com/hashicorp/hcl/v2 v2.18.0 +# github.com/hashicorp/hcl v1.0.0 +## explicit +# github.com/hashicorp/hcl/v2 v2.20.0 ## explicit; go 1.18 github.com/hashicorp/hcl/v2 github.com/hashicorp/hcl/v2/ext/customdecode @@ -1263,8 +1260,18 @@ github.com/hashicorp/terraform-svchost # github.com/hashicorp/yamux v0.1.1 ## explicit; go 1.15 github.com/hashicorp/yamux +# github.com/inconshreveable/mousetrap v1.0.0 +## explicit +# github.com/katbyte/andreyvit-diff v0.0.1 +## explicit; go 1.19 +# github.com/katbyte/sergi-go-diff v1.1.1 +## explicit; go 1.18 +# github.com/katbyte/terrafmt v0.5.3 +## explicit; go 1.18 # github.com/kr/text v0.2.0 ## explicit +# github.com/magiconair/properties v1.8.6 +## explicit; go 1.13 # github.com/magodo/terraform-provider-azurerm-example-gen v0.0.0-20220407025246-3a3ee0ab24a8 ## explicit; go 1.16 github.com/magodo/terraform-provider-azurerm-example-gen/examplegen @@ -1294,6 +1301,10 @@ github.com/mitchellh/reflectwalk # github.com/oklog/run v1.1.0 ## explicit; go 1.13 github.com/oklog/run +# github.com/pelletier/go-toml v1.9.5 +## explicit; go 1.12 +# github.com/pelletier/go-toml/v2 v2.0.1 +## explicit; go 1.16 # github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9 ## explicit; go 1.13 github.com/rickb777/date/period @@ -1303,6 +1314,22 @@ github.com/rickb777/plural # github.com/sergi/go-diff v1.2.0 ## explicit; go 1.12 github.com/sergi/go-diff/diffmatchpatch +# github.com/sirupsen/logrus v1.9.0 +## explicit; go 1.13 +# github.com/spf13/afero v1.9.2 +## explicit; go 1.16 +# github.com/spf13/cast v1.5.0 +## explicit; go 1.18 +# github.com/spf13/cobra v1.5.0 +## explicit; go 1.15 +# github.com/spf13/jwalterweatherman v1.1.0 +## explicit +# github.com/spf13/pflag v1.0.5 +## explicit; go 1.12 +# github.com/spf13/viper v1.12.0 +## explicit; go 1.17 +# github.com/subosito/gotenv v1.3.0 +## explicit; go 1.18 # github.com/tombuildsstuff/giovanni v0.27.0 ## explicit; go 1.21 github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/accounts @@ -1349,7 +1376,9 @@ github.com/vmihailenco/msgpack/v5/msgpcode github.com/vmihailenco/tagparser/v2 github.com/vmihailenco/tagparser/v2/internal github.com/vmihailenco/tagparser/v2/internal/parser -# github.com/zclconf/go-cty v1.14.0 +# github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 +## explicit; go 1.15 +# github.com/zclconf/go-cty v1.14.3 ## explicit; go 1.18 github.com/zclconf/go-cty/cty github.com/zclconf/go-cty/cty/convert @@ -1380,8 +1409,8 @@ golang.org/x/crypto/ssh/internal/bcrypt_pbkdf # golang.org/x/exp v0.0.0-20230905200255-921286631fa9 ## explicit; go 1.20 golang.org/x/exp/constraints -# golang.org/x/mod v0.12.0 -## explicit; go 1.17 +# golang.org/x/mod v0.16.0 +## explicit; go 1.18 golang.org/x/mod/internal/lazyregexp golang.org/x/mod/modfile golang.org/x/mod/module @@ -1401,7 +1430,6 @@ golang.org/x/oauth2/internal # golang.org/x/sys v0.18.0 ## explicit; go 1.18 golang.org/x/sys/cpu -golang.org/x/sys/execabs golang.org/x/sys/unix golang.org/x/sys/windows # golang.org/x/text v0.14.0 @@ -1410,20 +1438,21 @@ golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -# golang.org/x/tools v0.13.0 -## explicit; go 1.18 +# golang.org/x/tools v0.19.0 +## explicit; go 1.19 +golang.org/x/tools/cmd/stringer golang.org/x/tools/go/ast/astutil golang.org/x/tools/go/gcexportdata golang.org/x/tools/go/internal/packagesdriver golang.org/x/tools/go/packages golang.org/x/tools/go/types/objectpath golang.org/x/tools/imports +golang.org/x/tools/internal/aliases golang.org/x/tools/internal/event golang.org/x/tools/internal/event/core golang.org/x/tools/internal/event/keys golang.org/x/tools/internal/event/label golang.org/x/tools/internal/event/tag -golang.org/x/tools/internal/fastwalk golang.org/x/tools/internal/gcimporter golang.org/x/tools/internal/gocommand golang.org/x/tools/internal/gopathwalk @@ -1433,6 +1462,7 @@ golang.org/x/tools/internal/pkgbits golang.org/x/tools/internal/tokeninternal golang.org/x/tools/internal/typeparams golang.org/x/tools/internal/typesinternal +golang.org/x/tools/internal/versions # google.golang.org/appengine v1.6.8 ## explicit; go 1.11 google.golang.org/appengine @@ -1546,6 +1576,10 @@ google.golang.org/protobuf/types/known/emptypb google.golang.org/protobuf/types/known/timestamppb # gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f ## explicit +# gopkg.in/ini.v1 v1.66.4 +## explicit +# gopkg.in/yaml.v2 v2.4.0 +## explicit; go 1.15 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 From 32c76f80d4f051ad0ba5885aced6d2b859eaf294 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Tue, 28 May 2024 10:32:25 -0400 Subject: [PATCH 47/74] feat: use model struct for container_registry_cache_rule resource --- .../container_registry_cache_rule_resource.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index d91c8d2f72cc..90fe1f0999f2 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -63,8 +63,16 @@ func (ContainerRegistryCacheRule) Attributes() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{} } +type ContainerRegistryCacheRuleResourceModel struct { + Name string `tfschema:"name"` + ContainerRegistryId string `tfschema:"container_registry_id"` + CredentialSetId string `tfschema:"credential_set_id"` + SourceRepo string `tfschema:"source_repo"` + TargetRepo string `tfschema:"target_repo"` +} + func (ContainerRegistryCacheRule) ModelObject() interface{} { - return nil + return &ContainerRegistryCacheRuleReourceModel{} } func (ContainerRegistryCacheRule) ResourceType() string { From 02f0a2dd992193c711223423f55aa0619765bf00 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Tue, 28 May 2024 10:38:53 -0400 Subject: [PATCH 48/74] feat: validate credential set id --- .../containers/container_registry_cache_rule_resource.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 90fe1f0999f2..f1b40d945507 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/registries" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets" "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" @@ -42,6 +43,7 @@ func (ContainerRegistryCacheRule) Arguments() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeString, Optional: true, Description: "The ARM resource ID of the credential store which is associated with the cache rule.", + ValidateFunc: credentialsets.ValidateCredentialSetID, }, "source_repo": { Type: pluginsdk.TypeString, From 626a993738312fdc52f6502349814beccada0b82 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Tue, 28 May 2024 10:58:41 -0400 Subject: [PATCH 49/74] Update internal/services/containers/container_registry_cache_rule_data_source.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_data_source.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/services/containers/container_registry_cache_rule_data_source.go b/internal/services/containers/container_registry_cache_rule_data_source.go index af85a91788d6..a37fdc887c6e 100644 --- a/internal/services/containers/container_registry_cache_rule_data_source.go +++ b/internal/services/containers/container_registry_cache_rule_data_source.go @@ -35,6 +35,11 @@ func (ContainerRegistryCacheRuleDataSource) Read() sdk.ResourceFunc { return err } + var state ContainerRegistryCacheRuleDataSourceModel + if err := metadata.Decode(&state); err != nil { + return err + } + registryId, err := registries.ParseRegistryID(metadata.ResourceData.Get("container_registry_id").(string)) if err != nil { return err From 1f54be681bbfdd039f75678d2208872c6bd4c10e Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Tue, 28 May 2024 10:59:05 -0400 Subject: [PATCH 50/74] fix: vendor and formatting updates for cache_rule --- internal/services/containers/client/client.go | 6 +- .../container_registry_cache_rule_resource.go | 58 ++++--- .../2023-07-01/credentialsets/README.md | 99 ++++++++++++ .../2023-07-01/credentialsets/client.go | 26 ++++ .../2023-07-01/credentialsets/constants.go | 142 ++++++++++++++++++ .../credentialsets/id_credentialset.go | 139 +++++++++++++++++ .../2023-07-01/credentialsets/id_registry.go | 130 ++++++++++++++++ .../credentialsets/method_create.go | 75 +++++++++ .../credentialsets/method_delete.go | 70 +++++++++ .../2023-07-01/credentialsets/method_get.go | 54 +++++++ .../2023-07-01/credentialsets/method_list.go | 91 +++++++++++ .../credentialsets/method_update.go | 75 +++++++++ .../credentialsets/model_authcredential.go | 11 ++ .../credentialsets/model_credentialhealth.go | 10 ++ .../credentialsets/model_credentialset.go | 18 +++ .../model_credentialsetproperties.go | 29 ++++ .../model_credentialsetupdateparameters.go | 13 ++ .../model_credentialsetupdateproperties.go | 8 + .../2023-07-01/credentialsets/predicates.go | 27 ++++ .../2023-07-01/credentialsets/version.go | 12 ++ vendor/modules.txt | 1 + 21 files changed, 1061 insertions(+), 33 deletions(-) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_authcredential.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialhealth.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialset.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/version.go diff --git a/internal/services/containers/client/client.go b/internal/services/containers/client/client.go index 1a46b6eae409..46caae302dbf 100644 --- a/internal/services/containers/client/client.go +++ b/internal/services/containers/client/client.go @@ -27,7 +27,7 @@ import ( type Client struct { AgentPoolsClient *agentpools.AgentPoolsClient ContainerInstanceClient *containerinstance.ContainerInstanceClient - CacheRulesClient *cacherules.CacheRulesClient + CacheRulesClient *cacherules.CacheRulesClient ContainerRegistryClient_v2021_08_01_preview *containerregistry_v2021_08_01_preview.Client // v2019_06_01_preview is needed for container registry agent pools and tasks ContainerRegistryClient_v2019_06_01_preview *containerregistry_v2019_06_01_preview.Client @@ -63,7 +63,7 @@ func NewContainersClient(o *common.ClientOptions) (*Client, error) { return nil, err } -cacheRulesClient, err := cacherules.NewCacheRulesClientWithBaseURI(o.Environment.ResourceManager) + cacheRulesClient, err := cacherules.NewCacheRulesClientWithBaseURI(o.Environment.ResourceManager) if err != nil { return nil, fmt.Errorf("building Cache Rules client: %+v", err) } @@ -127,7 +127,7 @@ cacheRulesClient, err := cacherules.NewCacheRulesClientWithBaseURI(o.Environment return &Client{ AgentPoolsClient: agentPoolsClient, ContainerInstanceClient: containerInstanceClient, - CacheRulesClient: cacheRulesClient, + CacheRulesClient: cacheRulesClient, ContainerRegistryClient_v2021_08_01_preview: containerRegistryClient_v2021_08_01_preview, ContainerRegistryClient_v2019_06_01_preview: containerRegistryClient_v2019_06_01_preview, FleetUpdateRunsClient: fleetUpdateRunsClient, diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index f1b40d945507..b7fdcb23b871 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/registries" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets" "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" @@ -40,9 +40,9 @@ func (ContainerRegistryCacheRule) Arguments() map[string]*pluginsdk.Schema { ValidateFunc: registries.ValidateRegistryID, }, "credential_set_id": { - Type: pluginsdk.TypeString, - Optional: true, - Description: "The ARM resource ID of the credential store which is associated with the cache rule.", + Type: pluginsdk.TypeString, + Optional: true, + Description: "The ARM resource ID of the credential store which is associated with the cache rule.", ValidateFunc: credentialsets.ValidateCredentialSetID, }, "source_repo": { @@ -74,7 +74,7 @@ type ContainerRegistryCacheRuleResourceModel struct { } func (ContainerRegistryCacheRule) ModelObject() interface{} { - return &ContainerRegistryCacheRuleReourceModel{} + return &ContainerRegistryCacheRuleResourceModel{} } func (ContainerRegistryCacheRule) ResourceType() string { @@ -108,38 +108,36 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { metadata.ResourceData.Get("name").(string), ) + existing, err := cacheRulesClient.Get(ctx, id) + if err != nil { + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for presence of existing %s: %s", id, err) + } + } - existing, err := cacheRulesClient.Get(ctx, id) - if err != nil { if !response.WasNotFound(existing.HttpResponse) { - return fmt.Errorf("checking for presence of existing %s: %s", id, err) + return tf.ImportAsExistsError("azurerm_container_registry_cache_rule", id.ID()) } - } - - if !response.WasNotFound(existing.HttpResponse) { - return tf.ImportAsExistsError("azurerm_container_registry_cache_rule", id.ID()) - } - - // TODO: make a check that the repo is available in the registry. - // TODO: validate the source repo. - parameters := cacherules.CacheRule{ - Name: &id.CacheRuleName, - Properties: &cacherules.CacheRuleProperties{ - SourceRepository: pointer.To(config.SourceRepo), - TargetRepository: pointer.To(config.TargetRepo), - }, - } + // TODO: make a check that the repo is available in the registry. + // TODO: validate the source repo. - // Conditionally add CredentialSetResourceId if credentialSetId is not empty - if config.CredentialSetId != "" { - parameters.Properties.CredentialSetResourceId = pointer.To(config.CredentialSetId) - } + parameters := cacherules.CacheRule{ + Name: &id.CacheRuleName, + Properties: &cacherules.CacheRuleProperties{ + SourceRepository: pointer.To(config.SourceRepo), + TargetRepository: pointer.To(config.TargetRepo), + }, + } - if err := cacheRulesClient.CreateThenPoll(ctx, id, parameters); err != nil { - return fmt.Errorf("creating %s: %+v", id, err) - } + // Conditionally add CredentialSetResourceId if credentialSetId is not empty + if config.CredentialSetId != "" { + parameters.Properties.CredentialSetResourceId = pointer.To(config.CredentialSetId) + } + if err := cacheRulesClient.CreateThenPoll(ctx, id, parameters); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } metadata.SetID(id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/README.md new file mode 100644 index 000000000000..1928c694ff77 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/README.md @@ -0,0 +1,99 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets` Documentation + +The `credentialsets` SDK allows for interaction with the Azure Resource Manager Service `containerregistry` (API Version `2023-07-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/containerregistry/2023-07-01/credentialsets" +``` + + +### Client Initialization + +```go +client := credentialsets.NewCredentialSetsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `CredentialSetsClient.Create` + +```go +ctx := context.TODO() +id := credentialsets.NewCredentialSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "credentialSetValue") + +payload := credentialsets.CredentialSet{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CredentialSetsClient.Delete` + +```go +ctx := context.TODO() +id := credentialsets.NewCredentialSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "credentialSetValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CredentialSetsClient.Get` + +```go +ctx := context.TODO() +id := credentialsets.NewCredentialSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "credentialSetValue") + +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: `CredentialSetsClient.List` + +```go +ctx := context.TODO() +id := credentialsets.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `CredentialSetsClient.Update` + +```go +ctx := context.TODO() +id := credentialsets.NewCredentialSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "credentialSetValue") + +payload := credentialsets.CredentialSetUpdateParameters{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/client.go new file mode 100644 index 000000000000..cb20ca224462 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/client.go @@ -0,0 +1,26 @@ +package credentialsets + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialSetsClient struct { + Client *resourcemanager.Client +} + +func NewCredentialSetsClientWithBaseURI(sdkApi sdkEnv.Api) (*CredentialSetsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "credentialsets", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating CredentialSetsClient: %+v", err) + } + + return &CredentialSetsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/constants.go new file mode 100644 index 000000000000..ff71d8ceaa07 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/constants.go @@ -0,0 +1,142 @@ +package credentialsets + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialHealthStatus string + +const ( + CredentialHealthStatusHealthy CredentialHealthStatus = "Healthy" + CredentialHealthStatusUnhealthy CredentialHealthStatus = "Unhealthy" +) + +func PossibleValuesForCredentialHealthStatus() []string { + return []string{ + string(CredentialHealthStatusHealthy), + string(CredentialHealthStatusUnhealthy), + } +} + +func (s *CredentialHealthStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCredentialHealthStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCredentialHealthStatus(input string) (*CredentialHealthStatus, error) { + vals := map[string]CredentialHealthStatus{ + "healthy": CredentialHealthStatusHealthy, + "unhealthy": CredentialHealthStatusUnhealthy, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CredentialHealthStatus(input) + return &out, nil +} + +type CredentialName string + +const ( + CredentialNameCredentialOne CredentialName = "Credential1" +) + +func PossibleValuesForCredentialName() []string { + return []string{ + string(CredentialNameCredentialOne), + } +} + +func (s *CredentialName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCredentialName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCredentialName(input string) (*CredentialName, error) { + vals := map[string]CredentialName{ + "credential1": CredentialNameCredentialOne, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CredentialName(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go new file mode 100644 index 000000000000..2538c5cf3110 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_credentialset.go @@ -0,0 +1,139 @@ +package credentialsets + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&CredentialSetId{}) +} + +var _ resourceids.ResourceId = &CredentialSetId{} + +// CredentialSetId is a struct representing the Resource ID for a Credential Set +type CredentialSetId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string + CredentialSetName string +} + +// NewCredentialSetID returns a new CredentialSetId struct +func NewCredentialSetID(subscriptionId string, resourceGroupName string, registryName string, credentialSetName string) CredentialSetId { + return CredentialSetId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + CredentialSetName: credentialSetName, + } +} + +// ParseCredentialSetID parses 'input' into a CredentialSetId +func ParseCredentialSetID(input string) (*CredentialSetId, error) { + parser := resourceids.NewParserFromResourceIdType(&CredentialSetId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CredentialSetId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseCredentialSetIDInsensitively parses 'input' case-insensitively into a CredentialSetId +// note: this method should only be used for API response data and not user input +func ParseCredentialSetIDInsensitively(input string) (*CredentialSetId, error) { + parser := resourceids.NewParserFromResourceIdType(&CredentialSetId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CredentialSetId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *CredentialSetId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) + } + + if id.CredentialSetName, ok = input.Parsed["credentialSetName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "credentialSetName", input) + } + + return nil +} + +// ValidateCredentialSetID checks that 'input' can be parsed as a Credential Set ID +func ValidateCredentialSetID(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 := ParseCredentialSetID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Credential Set ID +func (id CredentialSetId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/credentialSets/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName, id.CredentialSetName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Credential Set ID +func (id CredentialSetId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + resourceids.StaticSegment("staticCredentialSets", "credentialSets", "credentialSets"), + resourceids.UserSpecifiedSegment("credentialSetName", "credentialSetValue"), + } +} + +// String returns a human-readable description of this Credential Set ID +func (id CredentialSetId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + fmt.Sprintf("Credential Set Name: %q", id.CredentialSetName), + } + return fmt.Sprintf("Credential Set (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go new file mode 100644 index 000000000000..e688b3adba09 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/id_registry.go @@ -0,0 +1,130 @@ +package credentialsets + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&RegistryId{}) +} + +var _ resourceids.ResourceId = &RegistryId{} + +// RegistryId is a struct representing the Resource ID for a Registry +type RegistryId struct { + SubscriptionId string + ResourceGroupName string + RegistryName string +} + +// NewRegistryID returns a new RegistryId struct +func NewRegistryID(subscriptionId string, resourceGroupName string, registryName string) RegistryId { + return RegistryId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RegistryName: registryName, + } +} + +// ParseRegistryID parses 'input' into a RegistryId +func ParseRegistryID(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := RegistryId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseRegistryIDInsensitively parses 'input' case-insensitively into a RegistryId +// note: this method should only be used for API response data and not user input +func ParseRegistryIDInsensitively(input string) (*RegistryId, error) { + parser := resourceids.NewParserFromResourceIdType(&RegistryId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := RegistryId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *RegistryId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.RegistryName, ok = input.Parsed["registryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "registryName", input) + } + + return nil +} + +// ValidateRegistryID checks that 'input' can be parsed as a Registry ID +func ValidateRegistryID(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 := ParseRegistryID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Registry ID +func (id RegistryId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RegistryName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Registry ID +func (id RegistryId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerRegistry", "Microsoft.ContainerRegistry", "Microsoft.ContainerRegistry"), + resourceids.StaticSegment("staticRegistries", "registries", "registries"), + resourceids.UserSpecifiedSegment("registryName", "registryValue"), + } +} + +// String returns a human-readable description of this Registry ID +func (id RegistryId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Registry Name: %q", id.RegistryName), + } + return fmt.Sprintf("Registry (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go new file mode 100644 index 000000000000..63256806132e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_create.go @@ -0,0 +1,75 @@ +package credentialsets + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *CredentialSet +} + +// Create ... +func (c CredentialSetsClient) Create(ctx context.Context, id CredentialSetId, input CredentialSet) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c CredentialSetsClient) CreateThenPoll(ctx context.Context, id CredentialSetId, input CredentialSet) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_delete.go new file mode 100644 index 000000000000..ccf0140f8ef7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_delete.go @@ -0,0 +1,70 @@ +package credentialsets + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c CredentialSetsClient) Delete(ctx context.Context, id CredentialSetId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c CredentialSetsClient) DeleteThenPoll(ctx context.Context, id CredentialSetId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go new file mode 100644 index 000000000000..83eef1b0ac5e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_get.go @@ -0,0 +1,54 @@ +package credentialsets + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *CredentialSet +} + +// Get ... +func (c CredentialSetsClient) Get(ctx context.Context, id CredentialSetId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model CredentialSet + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go new file mode 100644 index 000000000000..4b5743c50e66 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go @@ -0,0 +1,91 @@ +package credentialsets + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]CredentialSet +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []CredentialSet +} + +// List ... +func (c CredentialSetsClient) List(ctx context.Context, id RegistryId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/credentialSets", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]CredentialSet `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c CredentialSetsClient) ListComplete(ctx context.Context, id RegistryId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, CredentialSetOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c CredentialSetsClient) ListCompleteMatchingPredicate(ctx context.Context, id RegistryId, predicate CredentialSetOperationPredicate) (result ListCompleteResult, err error) { + items := make([]CredentialSet, 0) + + resp, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go new file mode 100644 index 000000000000..5451fc9ae4a8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_update.go @@ -0,0 +1,75 @@ +package credentialsets + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *CredentialSet +} + +// Update ... +func (c CredentialSetsClient) Update(ctx context.Context, id CredentialSetId, input CredentialSetUpdateParameters) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c CredentialSetsClient) UpdateThenPoll(ctx context.Context, id CredentialSetId, input CredentialSetUpdateParameters) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_authcredential.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_authcredential.go new file mode 100644 index 000000000000..913c42662acb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_authcredential.go @@ -0,0 +1,11 @@ +package credentialsets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AuthCredential struct { + CredentialHealth *CredentialHealth `json:"credentialHealth,omitempty"` + Name *CredentialName `json:"name,omitempty"` + PasswordSecretIdentifier *string `json:"passwordSecretIdentifier,omitempty"` + UsernameSecretIdentifier *string `json:"usernameSecretIdentifier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialhealth.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialhealth.go new file mode 100644 index 000000000000..ca30e48d6f25 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialhealth.go @@ -0,0 +1,10 @@ +package credentialsets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialHealth struct { + ErrorCode *string `json:"errorCode,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + Status *CredentialHealthStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialset.go new file mode 100644 index 000000000000..26779ccad5c0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialset.go @@ -0,0 +1,18 @@ +package credentialsets + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/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 CredentialSet struct { + Id *string `json:"id,omitempty"` + Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` + Name *string `json:"name,omitempty"` + Properties *CredentialSetProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetproperties.go new file mode 100644 index 000000000000..12298beeb143 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetproperties.go @@ -0,0 +1,29 @@ +package credentialsets + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialSetProperties struct { + AuthCredentials *[]AuthCredential `json:"authCredentials,omitempty"` + CreationDate *string `json:"creationDate,omitempty"` + LoginServer *string `json:"loginServer,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} + +func (o *CredentialSetProperties) GetCreationDateAsTime() (*time.Time, error) { + if o.CreationDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *CredentialSetProperties) SetCreationDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationDate = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateparameters.go new file mode 100644 index 000000000000..b43c63ad176e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateparameters.go @@ -0,0 +1,13 @@ +package credentialsets + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialSetUpdateParameters struct { + Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` + Properties *CredentialSetUpdateProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateproperties.go new file mode 100644 index 000000000000..718731e5d24c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/model_credentialsetupdateproperties.go @@ -0,0 +1,8 @@ +package credentialsets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialSetUpdateProperties struct { + AuthCredentials *[]AuthCredential `json:"authCredentials,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/predicates.go new file mode 100644 index 000000000000..c8e61730e35a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/predicates.go @@ -0,0 +1,27 @@ +package credentialsets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialSetOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p CredentialSetOperationPredicate) Matches(input CredentialSet) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/version.go new file mode 100644 index 000000000000..51ea87a3966c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/version.go @@ -0,0 +1,12 @@ +package credentialsets + +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 = "2023-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/credentialsets/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index b6e230524c02..ce20ce6dc684 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -383,6 +383,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01- github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/tokens github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/webhooks github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules +github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2019-08-01/containerservices github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-03-02-preview github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-03-02-preview/agentpools From c1266b3d54a5cce2ab3c1955f87ffb91f0c151b4 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Tue, 28 May 2024 11:43:14 -0400 Subject: [PATCH 51/74] feat: use model encoding/decoding for cache rule resource --- ...ntainer_registry_cache_rule_data_source.go | 6 +-- .../container_registry_cache_rule_resource.go | 45 ++++++++++++------- ...ainer_registry_cache_rule_resource_test.go | 2 +- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_data_source.go b/internal/services/containers/container_registry_cache_rule_data_source.go index a37fdc887c6e..7fa13849691f 100644 --- a/internal/services/containers/container_registry_cache_rule_data_source.go +++ b/internal/services/containers/container_registry_cache_rule_data_source.go @@ -8,6 +8,7 @@ import ( "fmt" "time" + "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/registries" "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" @@ -35,11 +36,6 @@ func (ContainerRegistryCacheRuleDataSource) Read() sdk.ResourceFunc { return err } - var state ContainerRegistryCacheRuleDataSourceModel - if err := metadata.Decode(&state); err != nil { - return err - } - registryId, err := registries.ParseRegistryID(metadata.ResourceData.Get("container_registry_id").(string)) if err != nil { return err diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index b7fdcb23b871..43f09faa644a 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -9,6 +9,7 @@ import ( "log" "time" + "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2021-08-01-preview/registries" "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" @@ -65,7 +66,7 @@ func (ContainerRegistryCacheRule) Attributes() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{} } -type ContainerRegistryCacheRuleResourceModel struct { +type ContainerRegistryCacheRuleModel struct { Name string `tfschema:"name"` ContainerRegistryId string `tfschema:"container_registry_id"` CredentialSetId string `tfschema:"credential_set_id"` @@ -74,7 +75,7 @@ type ContainerRegistryCacheRuleResourceModel struct { } func (ContainerRegistryCacheRule) ModelObject() interface{} { - return &ContainerRegistryCacheRuleResourceModel{} + return &ContainerRegistryCacheRuleModel{} } func (ContainerRegistryCacheRule) ResourceType() string { @@ -85,7 +86,7 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - cacheRulesClient := metadata.Client.Containers.ContainerRegistryClient_v2023_07_01.CacheRules + cacheRulesClient := metadata.Client.Containers.CacheRulesClient subscriptionId := metadata.Client.Account.SubscriptionId ctx, cancel := timeouts.ForCreate(metadata.Client.StopContext, metadata.ResourceData) @@ -141,7 +142,7 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { metadata.SetID(id) - return nil + return metadata.Encode(&config) }, } } @@ -150,8 +151,14 @@ func (ContainerRegistryCacheRule) Read() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 5 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - cacheRulesClient := metadata.Client.Containers.ContainerRegistryClient_v2023_07_01.CacheRules + cacheRulesClient := metadata.Client.Containers.CacheRulesClient ctx, cancel := timeouts.ForRead(metadata.Client.StopContext, metadata.ResourceData) + + var config ContainerRegistryCacheRuleModel + if err := metadata.Decode(&config); err != nil { + return err + } + defer cancel() id, err := cacherules.ParseCacheRuleID(metadata.ResourceData.Id()) @@ -168,25 +175,26 @@ func (ContainerRegistryCacheRule) Read() sdk.ResourceFunc { resp, err := cacheRulesClient.Get(ctx, *id) if err != nil { if response.WasNotFound(resp.HttpResponse) { - log.Printf("[DEBUG] Container Registry Cache Rule %s was not found.", *id) + log.Printf("%s was not found.", *id) return metadata.MarkAsGone(id) } return fmt.Errorf("retrieving Container Registry Cache Rule %s: %+v", *id, err) } - metadata.ResourceData.Set("name", id.CacheRuleName) - metadata.ResourceData.Set("container_registry_id", registryId.ID()) + registryIdString := registryId.ID() + config.Name = pointer.From(&id.CacheRuleName) + config.ContainerRegistryId = pointer.From(®istryIdString) if model := resp.Model; model != nil { if properties := model.Properties; properties != nil { - metadata.ResourceData.Set("source_repo", properties.SourceRepository) - metadata.ResourceData.Set("target_repo", properties.TargetRepository) - metadata.ResourceData.Set("credential_set_id", properties.CredentialSetResourceId) + config.SourceRepo = pointer.From(properties.SourceRepository) + config.TargetRepo = pointer.From(properties.TargetRepository) + config.CredentialSetId = pointer.From(properties.CredentialSetResourceId) } } - return nil + return metadata.Encode(&config) }, } } @@ -198,6 +206,11 @@ func (r ContainerRegistryCacheRule) Update() sdk.ResourceFunc { cacheRulesClient := metadata.Client.Containers.CacheRulesClient ctx, cancel := timeouts.ForUpdate(metadata.Client.StopContext, metadata.ResourceData) + var config ContainerRegistryCacheRuleModel + if err := metadata.Decode(&config); err != nil { + return err + } + defer cancel() log.Printf("[INFO] preparing arguments for Container Registry Cache Rule update.") @@ -207,11 +220,11 @@ func (r ContainerRegistryCacheRule) Update() sdk.ResourceFunc { } parameters := cacherules.CacheRuleUpdateParameters{} - credentialSetId := metadata.ResourceData.Get("credential_set_id").(string) + credentialSetId := pointer.To(config.CredentialSetId) - if credentialSetId != "" { + if *credentialSetId != "" { parameters = cacherules.CacheRuleUpdateParameters{ - Properties: &cacherules.CacheRuleUpdateProperties{CredentialSetResourceId: &credentialSetId}, + Properties: &cacherules.CacheRuleUpdateProperties{CredentialSetResourceId: credentialSetId}, } } else { //This is due to an issue with the Azure CacheRule API that prevents removing credentials @@ -224,7 +237,7 @@ func (r ContainerRegistryCacheRule) Update() sdk.ResourceFunc { metadata.SetID(id) - return nil + return metadata.Encode(&config) }, } } diff --git a/internal/services/containers/container_registry_cache_rule_resource_test.go b/internal/services/containers/container_registry_cache_rule_resource_test.go index 848b6f12029c..157982b9784f 100644 --- a/internal/services/containers/container_registry_cache_rule_resource_test.go +++ b/internal/services/containers/container_registry_cache_rule_resource_test.go @@ -5,12 +5,12 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/utils" ) type ContainerRegistryCacheRuleResource struct{} From ee45bef60121610df8c7755de521e3a5212a0f78 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Tue, 28 May 2024 11:56:14 -0400 Subject: [PATCH 52/74] feat: use CustomizeDiff to force rebuild and container registry update to empty --- .../container_registry_cache_rule_resource.go | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 43f09faa644a..d4be420b4879 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -219,16 +219,10 @@ func (r ContainerRegistryCacheRule) Update() sdk.ResourceFunc { return err } - parameters := cacherules.CacheRuleUpdateParameters{} credentialSetId := pointer.To(config.CredentialSetId) - if *credentialSetId != "" { - parameters = cacherules.CacheRuleUpdateParameters{ - Properties: &cacherules.CacheRuleUpdateProperties{CredentialSetResourceId: credentialSetId}, - } - } else { - //This is due to an issue with the Azure CacheRule API that prevents removing credentials - return fmt.Errorf("Error on update: credential_set_id must not be empty: %s", id) + parameters := cacherules.CacheRuleUpdateParameters{ + Properties: &cacherules.CacheRuleUpdateProperties{CredentialSetResourceId: credentialSetId}, } if err := cacheRulesClient.UpdateThenPoll(ctx, *id, parameters); err != nil { @@ -267,3 +261,17 @@ func (ContainerRegistryCacheRule) Delete() sdk.ResourceFunc { func (ContainerRegistryCacheRule) IDValidationFunc() pluginsdk.SchemaValidateFunc { return cacherules.ValidateCacheRuleID } + +func (ContainerRegistryCacheRule) CustomizeDiff() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + if oldVal, newVal := metadata.ResourceDiff.GetChange("container_registry_id"); oldVal.(string) != "" && newVal.(string) == "" { + if err := metadata.ResourceDiff.ForceNew("container_registry_id"); err != nil { + return err + } + } + return nil + }, + } +} From 0172fc64cbbab5e30592dc88828a7b9c28ec4d25 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Tue, 28 May 2024 20:54:43 -0400 Subject: [PATCH 53/74] fix: typo in resource diff logic for cache rule resource --- .../containers/container_registry_cache_rule_resource.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index d4be420b4879..fb002924733b 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -266,8 +266,8 @@ func (ContainerRegistryCacheRule) CustomizeDiff() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 5 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - if oldVal, newVal := metadata.ResourceDiff.GetChange("container_registry_id"); oldVal.(string) != "" && newVal.(string) == "" { - if err := metadata.ResourceDiff.ForceNew("container_registry_id"); err != nil { + if oldVal, newVal := metadata.ResourceDiff.GetChange("credential_set_id"); oldVal.(string) != "" && newVal.(string) == "" { + if err := metadata.ResourceDiff.ForceNew("credential_set_id"); err != nil { return err } } From e5a4c8fddc7d0d5d63151649387740070ebd3660 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Tue, 28 May 2024 21:09:33 -0400 Subject: [PATCH 54/74] feat: update cache rule name regex, and add unit tests --- .../container_registry_cache_rule_name.go | 2 +- ...container_registry_cache_rule_name_test.go | 67 +++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 internal/services/containers/validate/container_registry_cache_rule_name_test.go diff --git a/internal/services/containers/validate/container_registry_cache_rule_name.go b/internal/services/containers/validate/container_registry_cache_rule_name.go index 834e89a9640b..d1bf896c7a76 100644 --- a/internal/services/containers/validate/container_registry_cache_rule_name.go +++ b/internal/services/containers/validate/container_registry_cache_rule_name.go @@ -10,7 +10,7 @@ import ( func ContainerRegistryCacheRuleName(v interface{}, k string) (warnings []string, errors []error) { value := v.(string) - if !regexp.MustCompile(`^[a-zA-Z0-9-]+$`).MatchString(value) { + if !regexp.MustCompile(`^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`).MatchString(value) { errors = append(errors, fmt.Errorf( "alpha numeric characters optionally separated by '-' only are allowed in %q: %q", k, value)) } diff --git a/internal/services/containers/validate/container_registry_cache_rule_name_test.go b/internal/services/containers/validate/container_registry_cache_rule_name_test.go new file mode 100644 index 000000000000..d5f4075415d2 --- /dev/null +++ b/internal/services/containers/validate/container_registry_cache_rule_name_test.go @@ -0,0 +1,67 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package validate_test + +import ( + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" +) + +func TestAccContainerRegistryCacheRuleName_validation(t *testing.T) { + cases := []struct { + Value string + ErrCount int + }{ + { + Value: "four", + ErrCount: 1, + }, + { + Value: "5five", + ErrCount: 0, + }, + { + Value: "hello-world", + ErrCount: 0, + }, + { + Value: "-hello_world", + ErrCount: 1, + }, + { + Value: "helloWorld-", + ErrCount: 1, + }, + { + Value: "helloworld12", + ErrCount: 0, + }, + { + Value: "hello@world", + ErrCount: 1, + }, + + { + Value: "qfvbdsbvipqdbwsbddbdcwqffewsqwcdw21ddwqwd3324120", + ErrCount: 0, + }, + { + Value: "qfvbdsbvipqdbwsbddbdcwqffewsqwcdw21ddwqwd33241202", + ErrCount: 0, + }, + { + Value: "qfvbdsbvipqdbwsbddbdcwqfjjfewsqwcdw21ddwqwd3324120", + ErrCount: 1, + }, + } + + for _, tc := range cases { + _, errors := validate.ContainerRegistryCacheRuleName(tc.Value, "azurerm_container_registry_cache_rule") + + if len(errors) != tc.ErrCount { + t.Fatalf("Expected the Azure RM Container Registry Cache Rule Name to trigger a validation error: %v", errors) + } + } +} From 1242f5476f870cee153765a2e8de07fe1ed71255 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Wed, 29 May 2024 08:12:30 -0400 Subject: [PATCH 55/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index fb002924733b..522f177c5333 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -231,7 +231,7 @@ func (r ContainerRegistryCacheRule) Update() sdk.ResourceFunc { metadata.SetID(id) - return metadata.Encode(&config) + return nil }, } } From d54c21584055251119b2269d9a292afcfc0b28da Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Wed, 29 May 2024 08:12:38 -0400 Subject: [PATCH 56/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 522f177c5333..4d2ec2f6a10b 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -142,7 +142,7 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { metadata.SetID(id) - return metadata.Encode(&config) + return nil }, } } From cbc86fd6a19361443ea0da0ab94e2e4fb0df34f1 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Wed, 29 May 2024 08:12:54 -0400 Subject: [PATCH 57/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 4d2ec2f6a10b..034894f9a722 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -112,7 +112,7 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { existing, err := cacheRulesClient.Get(ctx, id) if err != nil { if !response.WasNotFound(existing.HttpResponse) { - return fmt.Errorf("checking for presence of existing %s: %s", id, err) + return fmt.Errorf("checking for presence of existing %s: %+v", id, err) } } From a53e585c054518dbcfd57c70c6033420e75c4df0 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Wed, 29 May 2024 08:13:06 -0400 Subject: [PATCH 58/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 034894f9a722..1c9bb113feb1 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -179,7 +179,7 @@ func (ContainerRegistryCacheRule) Read() sdk.ResourceFunc { return metadata.MarkAsGone(id) } - return fmt.Errorf("retrieving Container Registry Cache Rule %s: %+v", *id, err) + return fmt.Errorf("retrieving %s: %+v", *id, err) } registryIdString := registryId.ID() From c8001dfce9284be59f645c24536aca1ed105f128 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Wed, 29 May 2024 08:13:33 -0400 Subject: [PATCH 59/74] Update website/docs/r/container_registry_cache_rule.html.markdown Co-authored-by: stephybun --- website/docs/r/container_registry_cache_rule.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/r/container_registry_cache_rule.html.markdown b/website/docs/r/container_registry_cache_rule.html.markdown index 11a6c2aa4b95..9219490dec3b 100644 --- a/website/docs/r/container_registry_cache_rule.html.markdown +++ b/website/docs/r/container_registry_cache_rule.html.markdown @@ -44,13 +44,13 @@ The following arguments are supported: * `name` - (Required) Specifies the name of the Container Registry Cache Rule. Only Alphanumeric characters allowed. Changing this forces a new resource to be created. -* `container_registry_id` - (Required) The ID of the container registry where the cache rule should apply. Changing this forces a new resource to be created. +* `container_registry_id` - (Required) The ID of the Container Registry where the Cache Rule should apply. Changing this forces a new resource to be created. * `source_repo` - (Required) The name of the source repository path. Changing this forces a new resource to be created. * `target_repo` - (Required) The name of the new repository path to store artifacts. Changing this forces a new resource to be created. -* `credential_set_id` - (Optional) The ARM resource ID of the credential store which is associated with the cache rule. +* `credential_set_id` - (Optional) The ARM resource ID of the Credential Store which is associated with the Cache Rule. ## Attributes Reference From 1ed9e84dcc80f570ab61968efd02b38bce5a2404 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Wed, 29 May 2024 08:13:40 -0400 Subject: [PATCH 60/74] Update website/docs/r/container_registry_cache_rule.html.markdown Co-authored-by: stephybun --- website/docs/r/container_registry_cache_rule.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/container_registry_cache_rule.html.markdown b/website/docs/r/container_registry_cache_rule.html.markdown index 9219490dec3b..54d963b0d2c1 100644 --- a/website/docs/r/container_registry_cache_rule.html.markdown +++ b/website/docs/r/container_registry_cache_rule.html.markdown @@ -71,7 +71,7 @@ The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/l ## Import -Container Registry cache rules can be imported using the `resource id`, e.g. +Container Registry Cache Rules can be imported using the `resource id`, e.g. ```shell terraform import azurerm_container_registry_cache_rule.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule From 589352fad20f2ecf50e9e152b2f722f4e983486a Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Wed, 29 May 2024 08:14:37 -0400 Subject: [PATCH 61/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 1c9bb113feb1..8431395e4ebc 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -182,9 +182,8 @@ func (ContainerRegistryCacheRule) Read() sdk.ResourceFunc { return fmt.Errorf("retrieving %s: %+v", *id, err) } - registryIdString := registryId.ID() - config.Name = pointer.From(&id.CacheRuleName) - config.ContainerRegistryId = pointer.From(®istryIdString) + config.Name = id.CacheRuleName + config.ContainerRegistryId = registryId.ID() if model := resp.Model; model != nil { if properties := model.Properties; properties != nil { From 40e7c02e303f4f16bf8c6982551423fc6b404c06 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Wed, 29 May 2024 08:16:10 -0400 Subject: [PATCH 62/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 8431395e4ebc..f16afc089aa0 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -166,11 +166,7 @@ func (ContainerRegistryCacheRule) Read() sdk.ResourceFunc { return err } - subscriptionId := metadata.Client.Account.SubscriptionId - resourceGroupName := id.ResourceGroupName - registryName := id.RegistryName - - registryId := registries.NewRegistryID(subscriptionId, resourceGroupName, registryName) + registryId := registries.NewRegistryID(id.SubscriptionId, id.ResourceGroupName, id.RegistryName) resp, err := cacheRulesClient.Get(ctx, *id) if err != nil { From b96bc19a8a7d32c08ccbd1ca14f9689de216f427 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Wed, 29 May 2024 08:17:51 -0400 Subject: [PATCH 63/74] fix: remove unused files for cache rule --- .../parse/container_registry_cache_rule.go | 78 ----------- .../container_registry_cache_rule_test.go | 131 ------------------ .../container_registry_cache_rule_id.go | 26 ---- .../container_registry_cache_rule_id_test.go | 91 ------------ 4 files changed, 326 deletions(-) delete mode 100644 internal/services/containers/parse/container_registry_cache_rule.go delete mode 100644 internal/services/containers/parse/container_registry_cache_rule_test.go delete mode 100644 internal/services/containers/validate/container_registry_cache_rule_id.go delete mode 100644 internal/services/containers/validate/container_registry_cache_rule_id_test.go diff --git a/internal/services/containers/parse/container_registry_cache_rule.go b/internal/services/containers/parse/container_registry_cache_rule.go deleted file mode 100644 index 57a79cca8717..000000000000 --- a/internal/services/containers/parse/container_registry_cache_rule.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -type ContainerRegistryCacheRuleId struct { - SubscriptionId string - ResourceGroup string - RegistryName string - CacheRuleName string -} - -func NewContainerRegistryCacheRuleID(subscriptionId, resourceGroup, registryName, cacheRuleName string) ContainerRegistryCacheRuleId { - return ContainerRegistryCacheRuleId{ - SubscriptionId: subscriptionId, - ResourceGroup: resourceGroup, - RegistryName: registryName, - CacheRuleName: cacheRuleName, - } -} - -func (id ContainerRegistryCacheRuleId) String() string { - segments := []string{ - fmt.Sprintf("Cache Rule Name %q", id.CacheRuleName), - fmt.Sprintf("Registry Name %q", id.RegistryName), - fmt.Sprintf("Resource Group %q", id.ResourceGroup), - } - segmentsStr := strings.Join(segments, " / ") - return fmt.Sprintf("%s: (%s)", "Container Registry Cache Rule", segmentsStr) -} - -func (id ContainerRegistryCacheRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerRegistry/registries/%s/cacheRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.RegistryName, id.CacheRuleName) -} - -// ContainerRegistryCacheRuleID parses a ContainerRegistryCacheRule ID into an ContainerRegistryCacheRuleId struct -func ContainerRegistryCacheRuleID(input string) (*ContainerRegistryCacheRuleId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, fmt.Errorf("parsing %q as an ContainerRegistryCacheRule ID: %+v", input, err) - } - - resourceId := ContainerRegistryCacheRuleId{ - SubscriptionId: id.SubscriptionID, - ResourceGroup: id.ResourceGroup, - } - - if resourceId.SubscriptionId == "" { - return nil, fmt.Errorf("ID was missing the 'subscriptions' element") - } - - if resourceId.ResourceGroup == "" { - return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") - } - - if resourceId.RegistryName, err = id.PopSegment("registries"); err != nil { - return nil, err - } - if resourceId.CacheRuleName, err = id.PopSegment("cacheRules"); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} diff --git a/internal/services/containers/parse/container_registry_cache_rule_test.go b/internal/services/containers/parse/container_registry_cache_rule_test.go deleted file mode 100644 index 64e051e82eff..000000000000 --- a/internal/services/containers/parse/container_registry_cache_rule_test.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.Id = ContainerRegistryCacheRuleId{} - -func TestContainerRegistryCacheRuleIDFormatter(t *testing.T) { - actual := NewContainerRegistryCacheRuleID("12345678-1234-9876-4563-123456789012", "group1", "registry1", "rule1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/cacheRules/rule1" - if actual != expected { - t.Fatalf("Expected %q but got %q", expected, actual) - } -} - -func TestContainerRegistryCacheRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ContainerRegistryCacheRuleId - }{ - - { - // empty - Input: "", - Error: true, - }, - - { - // missing SubscriptionId - Input: "/", - Error: true, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Error: true, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Error: true, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Error: true, - }, - - { - // missing RegistryName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/", - Error: true, - }, - - { - // missing value for RegistryName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/", - Error: true, - }, - - { - // missing CacheRuleName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/", - Error: true, - }, - - { - // missing value for CacheRuleName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/cacheRules/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/cacheRules/rule1", - Expected: &ContainerRegistryCacheRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "group1", - RegistryName: "registry1", - CacheRuleName: "rule1", - }, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/GROUP1/PROVIDERS/MICROSOFT.CONTAINERREGISTRY/REGISTRIES/REGISTRY1/CACHERULES/RULE1", - Error: true, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ContainerRegistryCacheRuleID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %s", 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.ResourceGroup != v.Expected.ResourceGroup { - t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) - } - if actual.RegistryName != v.Expected.RegistryName { - t.Fatalf("Expected %q but got %q for RegistryName", v.Expected.RegistryName, actual.RegistryName) - } - if actual.CacheRuleName != v.Expected.CacheRuleName { - t.Fatalf("Expected %q but got %q for CacheRuleName", v.Expected.CacheRuleName, actual.CacheRuleName) - } - } -} diff --git a/internal/services/containers/validate/container_registry_cache_rule_id.go b/internal/services/containers/validate/container_registry_cache_rule_id.go deleted file mode 100644 index 71925851414f..000000000000 --- a/internal/services/containers/validate/container_registry_cache_rule_id.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - - "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/parse" -) - -func ContainerRegistryCacheRuleID(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 := parse.ContainerRegistryCacheRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/containers/validate/container_registry_cache_rule_id_test.go b/internal/services/containers/validate/container_registry_cache_rule_id_test.go deleted file mode 100644 index ae8770f3d9e3..000000000000 --- a/internal/services/containers/validate/container_registry_cache_rule_id_test.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestContainerRegistryCacheRuleID(t *testing.T) { - cases := []struct { - Input string - Valid bool - }{ - - { - // empty - Input: "", - Valid: false, - }, - - { - // missing SubscriptionId - Input: "/", - Valid: false, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Valid: false, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Valid: false, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Valid: false, - }, - - { - // missing RegistryName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/", - Valid: false, - }, - - { - // missing value for RegistryName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/", - Valid: false, - }, - - { - // missing CacheRuleName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/", - Valid: false, - }, - - { - // missing value for CacheRuleName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/cacheRules/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/cacheRules/rule1", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/GROUP1/PROVIDERS/MICROSOFT.CONTAINERREGISTRY/REGISTRIES/REGISTRY1/CACHERULES/RULE1", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := ContainerRegistryCacheRuleID(tc.Input, "test") - valid := len(errors) == 0 - - if tc.Valid != valid { - t.Fatalf("Expected %t but got %t", tc.Valid, valid) - } - } -} From f641de6a545c6de4451a6760515948d57a595e7c Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Wed, 29 May 2024 08:21:39 -0400 Subject: [PATCH 64/74] feat: remove obsolete TODO comments from cache rule resource --- .../containers/container_registry_cache_rule_resource.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index f16afc089aa0..39bcf53f9f9b 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -120,9 +120,6 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { return tf.ImportAsExistsError("azurerm_container_registry_cache_rule", id.ID()) } - // TODO: make a check that the repo is available in the registry. - // TODO: validate the source repo. - parameters := cacherules.CacheRule{ Name: &id.CacheRuleName, Properties: &cacherules.CacheRuleProperties{ From b4e6f88142e5bf08877d0fb58dc36a5a87ab3747 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Wed, 29 May 2024 08:27:25 -0400 Subject: [PATCH 65/74] fix: update go deps --- go.mod | 23 +-- go.sum | 454 +-------------------------------------------------------- 2 files changed, 6 insertions(+), 471 deletions(-) diff --git a/go.mod b/go.mod index f889b97df420..c0a15d20a392 100644 --- a/go.mod +++ b/go.mod @@ -45,9 +45,7 @@ require ( github.com/apparentlymart/go-textseg v1.0.0 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/gookit/color v1.5.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -55,7 +53,6 @@ require ( github.com/hashicorp/go-plugin v1.5.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/hc-install v0.6.0 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/hcl/v2 v2.20.0 // indirect github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80 // indirect github.com/hashicorp/logutils v1.0.0 // indirect @@ -66,12 +63,7 @@ require ( github.com/hashicorp/terraform-registry-address v0.2.2 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/katbyte/andreyvit-diff v0.0.1 // indirect - github.com/katbyte/sergi-go-diff v1.1.1 // indirect - github.com/katbyte/terrafmt v0.5.3 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/magiconair/properties v1.8.6 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -80,21 +72,10 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.1 // indirect github.com/rickb777/plural v1.4.1 // indirect - github.com/sirupsen/logrus v1.9.0 // indirect - github.com/spf13/afero v1.9.2 // indirect - github.com/spf13/cast v1.5.0 // indirect - github.com/spf13/cobra v1.5.0 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.12.0 // indirect - github.com/subosito/gotenv v1.3.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect github.com/zclconf/go-cty v1.14.3 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/mod v0.16.0 // indirect @@ -107,8 +88,6 @@ require ( google.golang.org/grpc v1.58.3 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect - gopkg.in/ini.v1 v1.66.4 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect software.sslmate.com/src/go-pkcs12 v0.4.0 // indirect ) diff --git a/go.sum b/go.sum index 5d420ca9b023..32386209e83c 100644 --- a/go.sum +++ b/go.sum @@ -1,43 +1,5 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go v66.0.0+incompatible h1:bmmC38SlE8/E81nNADlgmVGurPWMHDX2YNXVQMrBpEE= github.com/Azure/azure-sdk-for-go v66.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= @@ -60,8 +22,6 @@ github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+Z github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= @@ -85,18 +45,9 @@ github.com/btubbs/datetime v0.1.1/go.mod h1:n2BZ/2ltnRzNiz27aE3wUb2onNttQdC+WFxA github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/dave/jennifer v1.6.0 h1:MQ/6emI2xM7wt0tJzJzyUik2Q3Tcn2eE0vtYgh4GPVI= github.com/dave/jennifer v1.6.0/go.mod h1:AxTG893FiZKqxy3FP1kL80VMshSMuz2G+EgvszgGRnk= @@ -105,27 +56,16 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= github.com/go-git/go-billy/v5 v5.4.1/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg= github.com/go-git/go-git/v5 v5.8.1 h1:Zo79E4p7TRk0xoRgMq0RShiTHGKcKI4+DI6BfJc/Q+A= github.com/go-git/go-git/v5 v5.8.1/go.mod h1:FHFuoD6yGz5OSKEBK+aWN9Oah0q54Jxl0abmj6GnqAo= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= @@ -133,74 +73,21 @@ github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gookit/color v1.5.1 h1:Vjg2VEcdHpwq+oY63s/ksHrgJYCTo0bwWvmmYWdE9fQ= -github.com/gookit/color v1.5.1/go.mod h1:wZFzea4X8qN6vHOSP2apMb4/+w/orMznEzYsIHPaqKM= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -234,14 +121,8 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hc-install v0.6.0 h1:fDHnU7JNFNSQebVKYhHZ0va1bC6SrPQ8fpebsvNr2w4= github.com/hashicorp/hc-install v0.6.0/go.mod h1:10I912u3nntx9Umo1VAeYPUUuehk0aRQJYpMwbX5wQA= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl/v2 v2.18.0 h1:wYnG7Lt31t2zYkcquwgKo6MWXzRUDIeIVU5naZwHLl8= -github.com/hashicorp/hcl/v2 v2.18.0/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= github.com/hashicorp/hcl/v2 v2.20.0 h1:l++cRs/5jQOiKVvqXZm/P1ZEfVXJmvLS9WSVxkaeTb4= github.com/hashicorp/hcl/v2 v2.20.0/go.mod h1:WmcD/Ym72MDOOx5F62Ly+leloeu6H7m0pG7VBiU6pQk= github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80 h1:PFfGModn55JA0oBsvFghhj0v93me+Ctr3uHC/UmFAls= @@ -267,30 +148,17 @@ github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv2 github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/katbyte/andreyvit-diff v0.0.1 h1:2u6ofZeHrVgJjUzJ6JFlcfb3LeDq0rHxUH+WMHerELo= -github.com/katbyte/andreyvit-diff v0.0.1/go.mod h1:F6SME78YVaEk4agzLHhmsVwdVU+o/CtRnR0Bl9qBfrI= -github.com/katbyte/sergi-go-diff v1.1.1 h1:HelbPXYFHziR633zFq8QzwDY44jQ0Xy7COcLxNEWJtY= -github.com/katbyte/sergi-go-diff v1.1.1/go.mod h1:BxkLLDDB1iVQsnURErqoQMjkyXIlR0DefDKzZCUHNEw= -github.com/katbyte/terrafmt v0.5.3 h1:lBWDMv9YRurXFUuHXdpEJHkAO4YFluanIyiStK8zZJQ= -github.com/katbyte/terrafmt v0.5.3/go.mod h1:QSiA1xE/ld7Iy0VgByR8hWBmIy74Ah9XSeOYNE7JA7Y= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -298,8 +166,6 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= -github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magodo/terraform-provider-azurerm-example-gen v0.0.0-20220407025246-3a3ee0ab24a8 h1:HHSqLmPZaa8U66U7N2Gtx3gYptSHrUB/rB5t+6fZTkQ= github.com/magodo/terraform-provider-azurerm-example-gen v0.0.0-20220407025246-3a3ee0ab24a8/go.mod h1:iMzpAzVr2v/NUVie/apAYtZlFZYFndPcp6/E0VLxgAM= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -330,63 +196,38 @@ github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DV github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= -github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9 h1:czJCcoUR3FMpHnRQow2E84H/0CPrX1fMAGn9HugzyI4= github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9/go.mod h1:L8WrssTzvgYw34/Ppa0JpJfI7KKXZ2cVGI6Djt0brUU= github.com/rickb777/plural v1.2.0/go.mod h1:UdpyWFCGbo3mvK3f/PfZOAOrkjzJlYN/sD46XNWJ+Es= github.com/rickb777/plural v1.4.1 h1:5MMLcbIaapLFmvDGRT5iPk8877hpTPt8Y9cdSKRw9sU= github.com/rickb777/plural v1.4.1/go.mod h1:kdmXUpmKBJTS0FtG/TFumd//VBWsNTD7zOw7x4umxNw= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.2.0 h1:h9r9cf0+u7wSE+M183ZtMGgOJKiL96brpaz5ekfJCpM= github.com/skeema/knownhosts v1.2.0/go.mod h1:g4fPeYpque7P0xefxtGzV81ihjC8sX2IqpAoNkjxbMo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= -github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= -github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= -github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= -github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= github.com/tombuildsstuff/giovanni v0.27.0 h1:3CDNjauK78FIhvvCp0SAHlvNcPTcofR6zQXvxwhk4zY= github.com/tombuildsstuff/giovanni v0.27.0/go.mod h1:SviBdlwdVn2HyArdRABBqMUODBJ2adQHi+RFEVaO05I= github.com/tombuildsstuff/kermit v0.20240122.1123108 h1:icQaxsv/ANv/KC4Sr0V1trrWA/XIL+3QAVBDpiSTgj8= @@ -400,115 +241,34 @@ github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAh github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= -github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= -github.com/zclconf/go-cty v1.14.0 h1:/Xrd39K7DXbHzlisFP9c4pHao4yyf+/Ug9LEz+Y/yhc= -github.com/zclconf/go-cty v1.14.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty v1.14.3 h1:1JXy1XroaGrzZuG6X9dt7HL6s9AwbY+l4UNL8o5B6ho= github.com/zclconf/go-cty v1.14.3/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190502183928-7f726cade0ab/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -518,79 +278,29 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -606,12 +316,9 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= @@ -620,162 +327,25 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= @@ -787,29 +357,15 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8X gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= -gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= software.sslmate.com/src/go-pkcs12 v0.4.0 h1:H2g08FrTvSFKUj+D309j1DPfk5APnIdAQAB8aEykJ5k= software.sslmate.com/src/go-pkcs12 v0.4.0/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI= From 3f6ae054b2960e661c99e0aac1f3ce8799b6b898 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Wed, 29 May 2024 08:40:30 -0400 Subject: [PATCH 66/74] fix: linting and vendor modules --- ...ainer_registry_cache_rule_resource_test.go | 6 +-- vendor/modules.txt | 46 +------------------ 2 files changed, 5 insertions(+), 47 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource_test.go b/internal/services/containers/container_registry_cache_rule_resource_test.go index 157982b9784f..1e77f413fd5a 100644 --- a/internal/services/containers/container_registry_cache_rule_resource_test.go +++ b/internal/services/containers/container_registry_cache_rule_resource_test.go @@ -65,12 +65,12 @@ func (t ContainerRegistryCacheRuleResource) Exists(ctx context.Context, clients func (ContainerRegistryCacheRuleResource) basic(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { - features {} + features {} } resource "azurerm_resource_group" "test" { - name = "accTestRG-acr-cache-rule-%d" - location = "%s" + name = "accTestRG-acr-cache-rule-%d" + location = "%s" } resource "azurerm_container_registry" "test" { diff --git a/vendor/modules.txt b/vendor/modules.txt index ce20ce6dc684..26b2f2cac506 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -103,8 +103,6 @@ github.com/davecgh/go-spew/spew # github.com/fatih/color v1.15.0 ## explicit; go 1.17 github.com/fatih/color -# github.com/fsnotify/fsnotify v1.5.4 -## explicit; go 1.16 # github.com/gofrs/uuid v4.4.0+incompatible ## explicit github.com/gofrs/uuid @@ -130,8 +128,6 @@ github.com/google/go-cmp/cmp/internal/value # github.com/google/uuid v1.4.0 ## explicit github.com/google/uuid -# github.com/gookit/color v1.5.1 -## explicit; go 1.14 # github.com/hashicorp/errwrap v1.1.0 ## explicit github.com/hashicorp/errwrap @@ -1168,8 +1164,6 @@ github.com/hashicorp/hc-install/product github.com/hashicorp/hc-install/releases github.com/hashicorp/hc-install/src github.com/hashicorp/hc-install/version -# github.com/hashicorp/hcl v1.0.0 -## explicit # github.com/hashicorp/hcl/v2 v2.20.0 ## explicit; go 1.18 github.com/hashicorp/hcl/v2 @@ -1261,18 +1255,8 @@ github.com/hashicorp/terraform-svchost # github.com/hashicorp/yamux v0.1.1 ## explicit; go 1.15 github.com/hashicorp/yamux -# github.com/inconshreveable/mousetrap v1.0.0 -## explicit -# github.com/katbyte/andreyvit-diff v0.0.1 -## explicit; go 1.19 -# github.com/katbyte/sergi-go-diff v1.1.1 -## explicit; go 1.18 -# github.com/katbyte/terrafmt v0.5.3 -## explicit; go 1.18 -# github.com/kr/text v0.2.0 -## explicit -# github.com/magiconair/properties v1.8.6 -## explicit; go 1.13 +# github.com/kr/pretty v0.3.0 +## explicit; go 1.12 # github.com/magodo/terraform-provider-azurerm-example-gen v0.0.0-20220407025246-3a3ee0ab24a8 ## explicit; go 1.16 github.com/magodo/terraform-provider-azurerm-example-gen/examplegen @@ -1302,10 +1286,6 @@ github.com/mitchellh/reflectwalk # github.com/oklog/run v1.1.0 ## explicit; go 1.13 github.com/oklog/run -# github.com/pelletier/go-toml v1.9.5 -## explicit; go 1.12 -# github.com/pelletier/go-toml/v2 v2.0.1 -## explicit; go 1.16 # github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9 ## explicit; go 1.13 github.com/rickb777/date/period @@ -1315,22 +1295,6 @@ github.com/rickb777/plural # github.com/sergi/go-diff v1.2.0 ## explicit; go 1.12 github.com/sergi/go-diff/diffmatchpatch -# github.com/sirupsen/logrus v1.9.0 -## explicit; go 1.13 -# github.com/spf13/afero v1.9.2 -## explicit; go 1.16 -# github.com/spf13/cast v1.5.0 -## explicit; go 1.18 -# github.com/spf13/cobra v1.5.0 -## explicit; go 1.15 -# github.com/spf13/jwalterweatherman v1.1.0 -## explicit -# github.com/spf13/pflag v1.0.5 -## explicit; go 1.12 -# github.com/spf13/viper v1.12.0 -## explicit; go 1.17 -# github.com/subosito/gotenv v1.3.0 -## explicit; go 1.18 # github.com/tombuildsstuff/giovanni v0.27.0 ## explicit; go 1.21 github.com/tombuildsstuff/giovanni/storage/2023-11-03/blob/accounts @@ -1377,8 +1341,6 @@ github.com/vmihailenco/msgpack/v5/msgpcode github.com/vmihailenco/tagparser/v2 github.com/vmihailenco/tagparser/v2/internal github.com/vmihailenco/tagparser/v2/internal/parser -# github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 -## explicit; go 1.15 # github.com/zclconf/go-cty v1.14.3 ## explicit; go 1.18 github.com/zclconf/go-cty/cty @@ -1577,10 +1539,6 @@ google.golang.org/protobuf/types/known/emptypb google.golang.org/protobuf/types/known/timestamppb # gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f ## explicit -# gopkg.in/ini.v1 v1.66.4 -## explicit -# gopkg.in/yaml.v2 v2.4.0 -## explicit; go 1.15 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 From 827c7d352bcf29fd98884f3d1b51beaeba140a15 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Wed, 29 May 2024 11:32:27 -0400 Subject: [PATCH 67/74] fix: reinitialization of cache rule context --- .../containers/container_registry_cache_rule_resource.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 39bcf53f9f9b..2403a04ed408 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -88,7 +88,7 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { cacheRulesClient := metadata.Client.Containers.CacheRulesClient subscriptionId := metadata.Client.Account.SubscriptionId - ctx, cancel := timeouts.ForCreate(metadata.Client.StopContext, metadata.ResourceData) + _, cancel := timeouts.ForCreate(metadata.Client.StopContext, metadata.ResourceData) var config ContainerRegistryCacheRuleModel if err := metadata.Decode(&config); err != nil { @@ -149,7 +149,7 @@ func (ContainerRegistryCacheRule) Read() sdk.ResourceFunc { Timeout: 5 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { cacheRulesClient := metadata.Client.Containers.CacheRulesClient - ctx, cancel := timeouts.ForRead(metadata.Client.StopContext, metadata.ResourceData) + _, cancel := timeouts.ForRead(metadata.Client.StopContext, metadata.ResourceData) var config ContainerRegistryCacheRuleModel if err := metadata.Decode(&config); err != nil { @@ -196,7 +196,7 @@ func (r ContainerRegistryCacheRule) Update() sdk.ResourceFunc { Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { cacheRulesClient := metadata.Client.Containers.CacheRulesClient - ctx, cancel := timeouts.ForUpdate(metadata.Client.StopContext, metadata.ResourceData) + _, cancel := timeouts.ForUpdate(metadata.Client.StopContext, metadata.ResourceData) var config ContainerRegistryCacheRuleModel if err := metadata.Decode(&config); err != nil { @@ -233,7 +233,7 @@ func (ContainerRegistryCacheRule) Delete() sdk.ResourceFunc { Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { cacheRulesClient := metadata.Client.Containers.CacheRulesClient - ctx, cancel := timeouts.ForDelete(metadata.Client.StopContext, metadata.ResourceData) + _, cancel := timeouts.ForDelete(metadata.Client.StopContext, metadata.ResourceData) defer cancel() id, err := cacherules.ParseCacheRuleID(metadata.ResourceData.Id()) From 0b7520e70bf664fb41c444b7cf9e59ece4788691 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Wed, 29 May 2024 11:36:24 -0400 Subject: [PATCH 68/74] fix: update vendor --- .../containerregistry/2023-07-01/cacherules/method_list.go | 1 + .../containerregistry/2023-07-01/credentialsets/method_list.go | 1 + 2 files changed, 2 insertions(+) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_list.go index 51da42d2dc5a..6a864d4d8c69 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_list.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/cacherules/method_list.go @@ -72,6 +72,7 @@ func (c CacheRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id resp, err := c.List(ctx, id) if err != nil { + result.LatestHttpResponse = resp.HttpResponse err = fmt.Errorf("loading results: %+v", err) return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go index 4b5743c50e66..6887df87cf01 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerregistry/2023-07-01/credentialsets/method_list.go @@ -72,6 +72,7 @@ func (c CredentialSetsClient) ListCompleteMatchingPredicate(ctx context.Context, resp, err := c.List(ctx, id) if err != nil { + result.LatestHttpResponse = resp.HttpResponse err = fmt.Errorf("loading results: %+v", err) return } From 69448a8899bf2fc6be7af6e0501ae365cfb70c8c Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Thu, 30 May 2024 09:42:31 -0400 Subject: [PATCH 69/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 2403a04ed408..b3850c419ecd 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -88,14 +88,12 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { cacheRulesClient := metadata.Client.Containers.CacheRulesClient subscriptionId := metadata.Client.Account.SubscriptionId - _, cancel := timeouts.ForCreate(metadata.Client.StopContext, metadata.ResourceData) var config ContainerRegistryCacheRuleModel if err := metadata.Decode(&config); err != nil { return err } - defer cancel() log.Printf("[INFO] preparing arguments for Container Registry Cache Rule creation.") registryId, err := registries.ParseRegistryID(metadata.ResourceData.Get("container_registry_id").(string)) From 673946bf2ff6fc027ea82476aa252c3e034acd71 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Thu, 30 May 2024 09:42:37 -0400 Subject: [PATCH 70/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index b3850c419ecd..68ccbffbea23 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -194,14 +194,12 @@ func (r ContainerRegistryCacheRule) Update() sdk.ResourceFunc { Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { cacheRulesClient := metadata.Client.Containers.CacheRulesClient - _, cancel := timeouts.ForUpdate(metadata.Client.StopContext, metadata.ResourceData) var config ContainerRegistryCacheRuleModel if err := metadata.Decode(&config); err != nil { return err } - defer cancel() log.Printf("[INFO] preparing arguments for Container Registry Cache Rule update.") id, err := cacherules.ParseCacheRuleID(metadata.ResourceData.Id()) From f3a0ffa62dd8ed33ad53b0b98d4514f5a593c73f Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Thu, 30 May 2024 09:42:43 -0400 Subject: [PATCH 71/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 68ccbffbea23..7d48a0bfa7fc 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -229,8 +229,6 @@ func (ContainerRegistryCacheRule) Delete() sdk.ResourceFunc { Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { cacheRulesClient := metadata.Client.Containers.CacheRulesClient - _, cancel := timeouts.ForDelete(metadata.Client.StopContext, metadata.ResourceData) - defer cancel() id, err := cacherules.ParseCacheRuleID(metadata.ResourceData.Id()) if err != nil { From bf6bdea74e1da5c607b78a10308b77f21b841cc3 Mon Sep 17 00:00:00 2001 From: npk-amperon Date: Thu, 30 May 2024 09:42:50 -0400 Subject: [PATCH 72/74] Update internal/services/containers/container_registry_cache_rule_resource.go Co-authored-by: stephybun --- .../containers/container_registry_cache_rule_resource.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 7d48a0bfa7fc..7bbfdcce489a 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -147,14 +147,12 @@ func (ContainerRegistryCacheRule) Read() sdk.ResourceFunc { Timeout: 5 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { cacheRulesClient := metadata.Client.Containers.CacheRulesClient - _, cancel := timeouts.ForRead(metadata.Client.StopContext, metadata.ResourceData) var config ContainerRegistryCacheRuleModel if err := metadata.Decode(&config); err != nil { return err } - defer cancel() id, err := cacherules.ParseCacheRuleID(metadata.ResourceData.Id()) if err != nil { From 51199ef2dfcb48e9e1011ba127bcbe1808ea6ac4 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Thu, 30 May 2024 10:00:17 -0400 Subject: [PATCH 73/74] fix: remove unused import --- .../containers/container_registry_cache_rule_resource.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 7bbfdcce489a..10cc556fc3ba 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -18,7 +18,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" ) var _ sdk.Resource = ContainerRegistryCacheRule{} From 4f0806e2b66bcc61f2d462317a474a28ac971226 Mon Sep 17 00:00:00 2001 From: Noah Kontur Date: Thu, 30 May 2024 10:15:58 -0400 Subject: [PATCH 74/74] fix: fmt --- .../containers/container_registry_cache_rule_resource.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/services/containers/container_registry_cache_rule_resource.go b/internal/services/containers/container_registry_cache_rule_resource.go index 10cc556fc3ba..dea2029a1534 100644 --- a/internal/services/containers/container_registry_cache_rule_resource.go +++ b/internal/services/containers/container_registry_cache_rule_resource.go @@ -152,7 +152,6 @@ func (ContainerRegistryCacheRule) Read() sdk.ResourceFunc { return err } - id, err := cacherules.ParseCacheRuleID(metadata.ResourceData.Id()) if err != nil { return err