From 1360fbb424b10b027af16afddbf42b4fc51bd959 Mon Sep 17 00:00:00 2001 From: Steph Date: Tue, 31 Jan 2023 14:04:50 +0100 Subject: [PATCH 1/2] swap over databoxedge device --- go.mod | 2 +- go.sum | 4 +- .../services/databoxedge/client/client.go | 7 +- .../databox_edge_device_data_source.go | 25 +- .../databox_edge_device_resource.go | 102 ++- .../databox_edge_device_resource_test.go | 8 +- internal/services/databoxedge/parse/device.go | 69 -- .../services/databoxedge/parse/device_test.go | 112 --- internal/services/databoxedge/resourceids.go | 1 - .../databoxedge/validate/device_id.go | 23 - .../databoxedge/validate/device_id_test.go | 76 --- .../databoxedge/2020-12-01/devices/README.md | 279 ++++++++ .../databoxedge/2020-12-01/devices/client.go | 18 + .../2020-12-01/devices/constants.go | 636 ++++++++++++++++++ .../devices/id_databoxedgedevice.go | 124 ++++ .../devices/method_createorupdate_autorest.go | 79 +++ ...createorupdatesecuritysettings_autorest.go | 79 +++ .../devices/method_delete_autorest.go | 78 +++ .../method_downloadupdates_autorest.go | 78 +++ .../method_generatecertificate_autorest.go | 69 ++ .../2020-12-01/devices/method_get_autorest.go | 68 ++ .../method_getextendedinformation_autorest.go | 69 ++ .../method_getnetworksettings_autorest.go | 69 ++ .../method_getupdatesummary_autorest.go | 69 ++ .../devices/method_installupdates_autorest.go | 78 +++ .../method_listbyresourcegroup_autorest.go | 216 ++++++ .../method_listbysubscription_autorest.go | 216 ++++++ .../devices/method_scanforupdates_autorest.go | 78 +++ .../devices/method_update_autorest.go | 69 ++ ...thod_updateextendedinformation_autorest.go | 70 ++ .../method_uploadcertificate_autorest.go | 70 ++ .../model_asymmetricencryptedsecret.go | 10 + .../devices/model_databoxedgedevice.go | 22 + .../model_databoxedgedeviceextendedinfo.go | 11 + ...odel_databoxedgedeviceextendedinfopatch.go | 12 + ...databoxedgedeviceextendedinfoproperties.go | 16 + .../devices/model_databoxedgedevicepatch.go | 10 + .../model_databoxedgedeviceproperties.go | 23 + .../model_databoxedgedevicepropertiespatch.go | 8 + .../2020-12-01/devices/model_devicesecrets.go | 15 + .../2020-12-01/devices/model_edgeprofile.go | 8 + .../devices/model_edgeprofilepatch.go | 8 + .../devices/model_edgeprofilesubscription.go | 13 + .../model_edgeprofilesubscriptionpatch.go | 8 + .../devices/model_generatecertresponse.go | 10 + .../2020-12-01/devices/model_ipv4config.go | 10 + .../2020-12-01/devices/model_ipv6config.go | 10 + .../devices/model_networkadapter.go | 22 + .../devices/model_networkadapterposition.go | 9 + .../devices/model_networksettings.go | 11 + .../model_networksettingsproperties.go | 8 + .../devices/model_rawcertificatedata.go | 9 + .../devices/model_resourceidentity.go | 10 + .../devices/model_resourcemovedetails.go | 27 + .../2020-12-01/devices/model_secret.go | 9 + .../devices/model_securitysettings.go | 11 + .../model_securitysettingsproperties.go | 8 + .../2020-12-01/devices/model_sku.go | 9 + .../devices/model_subscriptionproperties.go | 12 + .../model_subscriptionregisteredfeatures.go | 9 + .../2020-12-01/devices/model_updatesummary.go | 11 + .../devices/model_updatesummaryproperties.go | 102 +++ .../devices/model_uploadcertificaterequest.go | 8 + .../model_uploadcertificateresponse.go | 15 + .../2020-12-01/devices/predicates.go | 34 + .../databoxedge/2020-12-01/devices/version.go | 12 + vendor/modules.txt | 3 +- 67 files changed, 3116 insertions(+), 358 deletions(-) delete mode 100644 internal/services/databoxedge/parse/device.go delete mode 100644 internal/services/databoxedge/parse/device_test.go delete mode 100644 internal/services/databoxedge/validate/device_id.go delete mode 100644 internal/services/databoxedge/validate/device_id_test.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/id_databoxedgedevice.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_createorupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_createorupdatesecuritysettings_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_delete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_downloadupdates_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_generatecertificate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_get_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_getextendedinformation_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_getnetworksettings_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_getupdatesummary_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_installupdates_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_listbyresourcegroup_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_listbysubscription_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_scanforupdates_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_update_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_updateextendedinformation_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_uploadcertificate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_asymmetricencryptedsecret.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedevice.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceextendedinfo.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceextendedinfopatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceextendedinfoproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedevicepatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedevicepropertiespatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_devicesecrets.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofilepatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofilesubscription.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofilesubscriptionpatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_generatecertresponse.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_ipv4config.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_ipv6config.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networkadapter.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networkadapterposition.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networksettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networksettingsproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_rawcertificatedata.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_resourceidentity.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_resourcemovedetails.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_secret.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_securitysettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_securitysettingsproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_sku.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_subscriptionproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_subscriptionregisteredfeatures.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_updatesummary.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_updatesummaryproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_uploadcertificaterequest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_uploadcertificateresponse.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/version.go diff --git a/go.mod b/go.mod index fbfb64ea7006..4cbc2afbd07b 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/google/go-cmp v0.5.9 github.com/google/uuid v1.1.2 github.com/hashicorp/go-azure-helpers v0.47.0 - github.com/hashicorp/go-azure-sdk v0.20230127.1133443 + github.com/hashicorp/go-azure-sdk v0.20230130.1140358 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/go-version v1.6.0 diff --git a/go.sum b/go.sum index 9e954915a9b8..ee43ae8b53ba 100644 --- a/go.sum +++ b/go.sum @@ -206,8 +206,8 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg= github.com/hashicorp/go-azure-helpers v0.47.0 h1:E90ZN2hqMtzI+tfGWCnNtyLZYG4csoKSs+hWZZ8ywSM= github.com/hashicorp/go-azure-helpers v0.47.0/go.mod h1:WiJNl0fD6PoM/MYuGTZ8yuzIaXQR3m2H2g6+EJ8nSwc= -github.com/hashicorp/go-azure-sdk v0.20230127.1133443 h1:6M4nR/OR+QLCCLbIANcikNkhVMVtYguduOfokUNxKDE= -github.com/hashicorp/go-azure-sdk v0.20230127.1133443/go.mod h1:SFjw1090GggVoFnsRoFb8J5JUyJEz5C9zGojxtJm+kU= +github.com/hashicorp/go-azure-sdk v0.20230130.1140358 h1:2Z/r04wEbS5E/pHB/QuRicbKKJJZAZFx/Qg+/9uh/I8= +github.com/hashicorp/go-azure-sdk v0.20230130.1140358/go.mod h1:SFjw1090GggVoFnsRoFb8J5JUyJEz5C9zGojxtJm+kU= github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= diff --git a/internal/services/databoxedge/client/client.go b/internal/services/databoxedge/client/client.go index a4c5018a2b5b..4ae4e1ef2a73 100644 --- a/internal/services/databoxedge/client/client.go +++ b/internal/services/databoxedge/client/client.go @@ -1,17 +1,18 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" // nolint: staticcheck + "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" + "github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) type Client struct { - DeviceClient *databoxedge.DevicesClient + DeviceClient *devices.DevicesClient OrderClient *databoxedge.OrdersClient } func NewClient(o *common.ClientOptions) *Client { - deviceClient := databoxedge.NewDevicesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + deviceClient := devices.NewDevicesClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&deviceClient.Client, o.ResourceManagerAuthorizer) orderClient := databoxedge.NewOrdersClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) diff --git a/internal/services/databoxedge/databox_edge_device_data_source.go b/internal/services/databoxedge/databox_edge_device_data_source.go index da696e3787f7..bb831d3c4cca 100644 --- a/internal/services/databoxedge/databox_edge_device_data_source.go +++ b/internal/services/databoxedge/databox_edge_device_data_source.go @@ -6,15 +6,14 @@ import ( "log" "time" + "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/databoxedge/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/databoxedge/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/utils" ) type EdgeDeviceDataSource struct{} @@ -134,11 +133,11 @@ func (d EdgeDeviceDataSource) Read() sdk.ResourceFunc { return fmt.Errorf("decoding: %+v", err) } - id := parse.NewDeviceID(subscriptionId, metaModel.ResourceGroupName, metaModel.Name) + id := devices.NewDataBoxEdgeDeviceID(subscriptionId, metaModel.ResourceGroupName, metaModel.Name) - resp, err := client.Get(ctx, id.DataBoxEdgeDeviceName, id.ResourceGroup) + resp, err := client.Get(ctx, id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { log.Printf("[INFO] %s was not found - removing from state", id) return metadata.MarkAsGone(id) } @@ -147,14 +146,16 @@ func (d EdgeDeviceDataSource) Read() sdk.ResourceFunc { state := EdgeDeviceModel{ Name: id.DataBoxEdgeDeviceName, - ResourceGroupName: id.ResourceGroup, - Location: location.NormalizeNilable(resp.Location), + ResourceGroupName: id.ResourceGroupName, } - if props := resp.DeviceProperties; props != nil { - state.DeviceProperties = flattenDeviceProperties(props) - state.SkuName = flattenDeviceSku(resp.Sku) - state.Tags = tags.ToTypedObject(resp.Tags) + if model := resp.Model; model != nil { + state.Location = location.Normalize(model.Location) + if props := model.Properties; props != nil { + state.DeviceProperties = flattenDeviceProperties(props) + } + state.SkuName = flattenDeviceSku(model.Sku) + state.Tags = *model.Tags } metadata.SetID(id) diff --git a/internal/services/databoxedge/databox_edge_device_resource.go b/internal/services/databoxedge/databox_edge_device_resource.go index b9dd0b3ea28a..35443c47ba7c 100644 --- a/internal/services/databoxedge/databox_edge_device_resource.go +++ b/internal/services/databoxedge/databox_edge_device_resource.go @@ -6,15 +6,15 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" // nolint: staticcheck + "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/databoxedge/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/databoxedge/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -54,7 +54,7 @@ func (r EdgeDeviceResource) ResourceType() string { } func (r EdgeDeviceResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { - return validate.DeviceID + return devices.ValidateDataBoxEdgeDeviceID } func (r EdgeDeviceResource) Arguments() map[string]*schema.Schema { @@ -77,7 +77,7 @@ func (r EdgeDeviceResource) Arguments() map[string]*schema.Schema { ValidateFunc: validate.DataboxEdgeDeviceSkuName, }, - "tags": tags.Schema(), + "tags": commonschema.Tags(), } } @@ -163,34 +163,30 @@ func (r EdgeDeviceResource) Create() sdk.ResourceFunc { return fmt.Errorf("decoding %+v", err) } - id := parse.NewDeviceID(subscriptionId, metaModel.ResourceGroupName, metaModel.Name) + id := devices.NewDataBoxEdgeDeviceID(subscriptionId, metaModel.ResourceGroupName, metaModel.Name) // sdk method is Get(ctx context.Context, deviceName string, resourceGroupName string) - existing, err := client.Get(ctx, id.DataBoxEdgeDeviceName, id.ResourceGroup) + existing, err := client.Get(ctx, id) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for presence of existing %s: %+v", id, err) } } - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return tf.ImportAsExistsError("azurerm_databox_edge_device", id.ID()) } - dataBoxEdgeDevice := databoxedge.Device{ - Location: utils.String(location.Normalize(metaModel.Location)), + dataBoxEdgeDevice := devices.DataBoxEdgeDevice{ + Location: location.Normalize(metaModel.Location), Sku: expandDeviceSku(metaModel.SkuName), - Tags: tags.FromTypedObject(metaModel.Tags), + Tags: &metaModel.Tags, } - future, err := client.CreateOrUpdate(ctx, id.DataBoxEdgeDeviceName, dataBoxEdgeDevice, id.ResourceGroup) - if err != nil { + if err := client.CreateOrUpdateThenPoll(ctx, id, dataBoxEdgeDevice); err != nil { return fmt.Errorf("creating %s: %+v", id, err) } - if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for creation of %s: %+v", id, err) - } - metadata.SetID(id) + return nil }, } @@ -202,14 +198,14 @@ func (r EdgeDeviceResource) Read() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.DataboxEdge.DeviceClient - id, err := parse.DeviceID(metadata.ResourceData.Id()) + id, err := devices.ParseDataBoxEdgeDeviceID(metadata.ResourceData.Id()) if err != nil { return fmt.Errorf("parse: %+v", err) } - resp, err := client.Get(ctx, id.DataBoxEdgeDeviceName, id.ResourceGroup) + resp, err := client.Get(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { log.Printf("[INFO] %s was not found - removing from state", id) return metadata.MarkAsGone(id) } @@ -218,14 +214,16 @@ func (r EdgeDeviceResource) Read() sdk.ResourceFunc { state := EdgeDeviceModel{ Name: id.DataBoxEdgeDeviceName, - ResourceGroupName: id.ResourceGroup, - Location: location.NormalizeNilable(resp.Location), + ResourceGroupName: id.ResourceGroupName, } - if props := resp.DeviceProperties; props != nil { - state.DeviceProperties = flattenDeviceProperties(props) - state.SkuName = flattenDeviceSku(resp.Sku) - state.Tags = tags.ToTypedObject(resp.Tags) + if model := resp.Model; model != nil { + state.Location = location.Normalize(model.Location) + if props := model.Properties; props != nil { + state.DeviceProperties = flattenDeviceProperties(props) + } + state.SkuName = flattenDeviceSku(model.Sku) + state.Tags = *model.Tags } metadata.SetID(id) @@ -241,7 +239,7 @@ func (r EdgeDeviceResource) Update() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.DataboxEdge.DeviceClient - id, err := parse.DeviceID(metadata.ResourceData.Id()) + id, err := devices.ParseDataBoxEdgeDeviceID(metadata.ResourceData.Id()) if err != nil { return err } @@ -251,12 +249,12 @@ func (r EdgeDeviceResource) Update() sdk.ResourceFunc { return fmt.Errorf("decoding: %+v", err) } - parameters := databoxedge.DevicePatch{} + parameters := devices.DataBoxEdgeDevicePatch{} if metadata.ResourceData.HasChange("tags") { - parameters.Tags = tags.FromTypedObject(metaModel.Tags) + parameters.Tags = &metaModel.Tags } - if _, err := client.Update(ctx, id.DataBoxEdgeDeviceName, parameters, id.ResourceGroup); err != nil { + if _, err := client.Update(ctx, *id, parameters); err != nil { return fmt.Errorf("updating %s: %+v", *id, err) } @@ -271,7 +269,7 @@ func (r EdgeDeviceResource) Delete() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.DataboxEdge.DeviceClient - id, err := parse.DeviceID(metadata.ResourceData.Id()) + id, err := devices.ParseDataBoxEdgeDeviceID(metadata.ResourceData.Id()) if err != nil { return err } @@ -280,20 +278,16 @@ func (r EdgeDeviceResource) Delete() sdk.ResourceFunc { if err := metadata.Decode(&metaModel); err != nil { return fmt.Errorf("decoding: %+v", err) } - future, err := client.Delete(ctx, id.DataBoxEdgeDeviceName, id.ResourceGroup) - if err != nil { + if err := client.DeleteThenPoll(ctx, *id); err != nil { return fmt.Errorf("deleting %s: %+v", *id, err) } - if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for deletion of %s: %+v", *id, err) - } return nil }, } } -func expandDeviceSku(input string) *databoxedge.Sku { +func expandDeviceSku(input string) *devices.Sku { if len(input) == 0 { return nil } @@ -303,13 +297,13 @@ func expandDeviceSku(input string) *databoxedge.Sku { return nil } - return &databoxedge.Sku{ - Name: databoxedge.SkuName(v.Name), - Tier: databoxedge.SkuTier(v.Tier), + return &devices.Sku{ + Name: utils.ToPtr(devices.SkuName(v.Name)), + Tier: utils.ToPtr(devices.SkuTier(v.Tier)), } } -func flattenDeviceProperties(input *databoxedge.DeviceProperties) []DevicePropertiesModel { +func flattenDeviceProperties(input *devices.DataBoxEdgeDeviceProperties) []DevicePropertiesModel { output := make([]DevicePropertiesModel, 0) configuredRoleTypes := make([]string, 0) @@ -333,8 +327,8 @@ func flattenDeviceProperties(input *databoxedge.DeviceProperties) []DeviceProper o.ConfiguredRoleTypes = configuredRoleTypes } - if input.DataBoxEdgeDeviceStatus != "" { - status = string(input.DataBoxEdgeDeviceStatus) + if v := input.DataBoxEdgeDeviceStatus; v != nil && *v != "" { + status = string(*v) o.Status = status } @@ -363,13 +357,13 @@ func flattenDeviceProperties(input *databoxedge.DeviceProperties) []DeviceProper o.SoftwareVersion = softwareVersion } - if input.DeviceType != "" { - deviceType = string(input.DeviceType) + if v := input.DeviceType; v != nil && *v != "" { + deviceType = string(*v) o.Type = deviceType } if input.NodeCount != nil { - nodeCount = *input.NodeCount + nodeCount = int32(*input.NodeCount) o.NodeCount = nodeCount } @@ -389,22 +383,22 @@ func flattenDeviceProperties(input *databoxedge.DeviceProperties) []DeviceProper return output } -func flattenDeviceSku(input *databoxedge.Sku) string { +func flattenDeviceSku(input *devices.Sku) string { if input == nil { return "" } - var name databoxedge.SkuName - var tier databoxedge.SkuTier + var name devices.SkuName + var tier devices.SkuTier - if input.Name != "" { - name = input.Name + if v := input.Name; v != nil && *v != "" { + name = *v } - if input.Tier != "" { - tier = input.Tier + if v := input.Tier; v != nil && *v != "" { + tier = *v } else { - tier = databoxedge.Standard + tier = devices.SkuTierStandard } skuName := fmt.Sprintf("%s-%s", name, tier) diff --git a/internal/services/databoxedge/databox_edge_device_resource_test.go b/internal/services/databoxedge/databox_edge_device_resource_test.go index 929eb2b17943..73fe8fb28763 100644 --- a/internal/services/databoxedge/databox_edge_device_resource_test.go +++ b/internal/services/databoxedge/databox_edge_device_resource_test.go @@ -5,10 +5,10 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices" "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/databoxedge/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -97,17 +97,17 @@ func TestAccDataboxEdgeDevice_update(t *testing.T) { } func (DataboxEdgeDeviceResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.DeviceID(state.ID) + id, err := devices.ParseDataBoxEdgeDeviceID(state.ID) if err != nil { return nil, err } - resp, err := clients.DataboxEdge.DeviceClient.Get(ctx, id.DataBoxEdgeDeviceName, id.ResourceGroup) + resp, err := clients.DataboxEdge.DeviceClient.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } - return utils.Bool(resp.DeviceProperties != nil), nil + return utils.Bool(resp.Model != nil), nil } // Location has to be hard coded due to limited support of locations for this resource diff --git a/internal/services/databoxedge/parse/device.go b/internal/services/databoxedge/parse/device.go deleted file mode 100644 index c9cbeccb0c3d..000000000000 --- a/internal/services/databoxedge/parse/device.go +++ /dev/null @@ -1,69 +0,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 DeviceId struct { - SubscriptionId string - ResourceGroup string - DataBoxEdgeDeviceName string -} - -func NewDeviceID(subscriptionId, resourceGroup, dataBoxEdgeDeviceName string) DeviceId { - return DeviceId{ - SubscriptionId: subscriptionId, - ResourceGroup: resourceGroup, - DataBoxEdgeDeviceName: dataBoxEdgeDeviceName, - } -} - -func (id DeviceId) String() string { - segments := []string{ - fmt.Sprintf("Data Box Edge Device Name %q", id.DataBoxEdgeDeviceName), - fmt.Sprintf("Resource Group %q", id.ResourceGroup), - } - segmentsStr := strings.Join(segments, " / ") - return fmt.Sprintf("%s: (%s)", "Device", segmentsStr) -} - -func (id DeviceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.DataBoxEdgeDeviceName) -} - -// DeviceID parses a Device ID into an DeviceId struct -func DeviceID(input string) (*DeviceId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, err - } - - resourceId := DeviceId{ - 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.DataBoxEdgeDeviceName, err = id.PopSegment("dataBoxEdgeDevices"); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} diff --git a/internal/services/databoxedge/parse/device_test.go b/internal/services/databoxedge/parse/device_test.go deleted file mode 100644 index 27357aa8665d..000000000000 --- a/internal/services/databoxedge/parse/device_test.go +++ /dev/null @@ -1,112 +0,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 = DeviceId{} - -func TestDeviceIDFormatter(t *testing.T) { - actual := NewDeviceID("12345678-1234-9876-4563-123456789012", "resGroup1", "device1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/device1" - if actual != expected { - t.Fatalf("Expected %q but got %q", expected, actual) - } -} - -func TestDeviceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DeviceId - }{ - - { - // 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 DataBoxEdgeDeviceName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DataBoxEdge/", - Error: true, - }, - - { - // missing value for DataBoxEdgeDeviceName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/device1", - Expected: &DeviceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - DataBoxEdgeDeviceName: "device1", - }, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.DATABOXEDGE/DATABOXEDGEDEVICES/DEVICE1", - Error: true, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := DeviceID(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.DataBoxEdgeDeviceName != v.Expected.DataBoxEdgeDeviceName { - t.Fatalf("Expected %q but got %q for DataBoxEdgeDeviceName", v.Expected.DataBoxEdgeDeviceName, actual.DataBoxEdgeDeviceName) - } - } -} diff --git a/internal/services/databoxedge/resourceids.go b/internal/services/databoxedge/resourceids.go index a5583e75e9ba..61380c4cde4f 100644 --- a/internal/services/databoxedge/resourceids.go +++ b/internal/services/databoxedge/resourceids.go @@ -1,4 +1,3 @@ package databoxedge -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=Device -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/device1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=Order -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/device1/orders/default diff --git a/internal/services/databoxedge/validate/device_id.go b/internal/services/databoxedge/validate/device_id.go deleted file mode 100644 index 6b61d2cf4c6d..000000000000 --- a/internal/services/databoxedge/validate/device_id.go +++ /dev/null @@ -1,23 +0,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/databoxedge/parse" -) - -func DeviceID(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.DeviceID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/databoxedge/validate/device_id_test.go b/internal/services/databoxedge/validate/device_id_test.go deleted file mode 100644 index 9bba5e8b2e6e..000000000000 --- a/internal/services/databoxedge/validate/device_id_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestDeviceID(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 DataBoxEdgeDeviceName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DataBoxEdge/", - Valid: false, - }, - - { - // missing value for DataBoxEdgeDeviceName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/device1", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.DATABOXEDGE/DATABOXEDGEDEVICES/DEVICE1", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := DeviceID(tc.Input, "test") - valid := len(errors) == 0 - - if tc.Valid != valid { - t.Fatalf("Expected %t but got %t", tc.Valid, valid) - } - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/README.md new file mode 100644 index 000000000000..18b123b6df2e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/README.md @@ -0,0 +1,279 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices` Documentation + +The `devices` SDK allows for interaction with the Azure Resource Manager Service `databoxedge` (API Version `2020-12-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices" +``` + + +### Client Initialization + +```go +client := devices.NewDevicesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DevicesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue") + +payload := devices.DataBoxEdgeDevice{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DevicesClient.CreateOrUpdateSecuritySettings` + +```go +ctx := context.TODO() +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue") + +payload := devices.SecuritySettings{ + // ... +} + + +if err := client.CreateOrUpdateSecuritySettingsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DevicesClient.Delete` + +```go +ctx := context.TODO() +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `DevicesClient.DownloadUpdates` + +```go +ctx := context.TODO() +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue") + +if err := client.DownloadUpdatesThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `DevicesClient.GenerateCertificate` + +```go +ctx := context.TODO() +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue") + +read, err := client.GenerateCertificate(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DevicesClient.Get` + +```go +ctx := context.TODO() +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue") + +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: `DevicesClient.GetExtendedInformation` + +```go +ctx := context.TODO() +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue") + +read, err := client.GetExtendedInformation(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DevicesClient.GetNetworkSettings` + +```go +ctx := context.TODO() +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue") + +read, err := client.GetNetworkSettings(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DevicesClient.GetUpdateSummary` + +```go +ctx := context.TODO() +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue") + +read, err := client.GetUpdateSummary(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DevicesClient.InstallUpdates` + +```go +ctx := context.TODO() +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue") + +if err := client.InstallUpdatesThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `DevicesClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := devices.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ListByResourceGroup(ctx, id, devices.DefaultListByResourceGroupOperationOptions())` can be used to do batched pagination +items, err := client.ListByResourceGroupComplete(ctx, id, devices.DefaultListByResourceGroupOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `DevicesClient.ListBySubscription` + +```go +ctx := context.TODO() +id := devices.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id, devices.DefaultListBySubscriptionOperationOptions())` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id, devices.DefaultListBySubscriptionOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `DevicesClient.ScanForUpdates` + +```go +ctx := context.TODO() +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue") + +if err := client.ScanForUpdatesThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `DevicesClient.Update` + +```go +ctx := context.TODO() +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue") + +payload := devices.DataBoxEdgeDevicePatch{ + // ... +} + + +read, err := client.Update(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DevicesClient.UpdateExtendedInformation` + +```go +ctx := context.TODO() +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue") + +payload := devices.DataBoxEdgeDeviceExtendedInfoPatch{ + // ... +} + + +read, err := client.UpdateExtendedInformation(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DevicesClient.UploadCertificate` + +```go +ctx := context.TODO() +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue") + +payload := devices.UploadCertificateRequest{ + // ... +} + + +read, err := client.UploadCertificate(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/databoxedge/2020-12-01/devices/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/client.go new file mode 100644 index 000000000000..826aa3d578b2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/client.go @@ -0,0 +1,18 @@ +package devices + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DevicesClient struct { + Client autorest.Client + baseUri string +} + +func NewDevicesClientWithBaseURI(endpoint string) DevicesClient { + return DevicesClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/constants.go new file mode 100644 index 000000000000..b0d745fa1e8c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/constants.go @@ -0,0 +1,636 @@ +package devices + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AuthenticationType string + +const ( + AuthenticationTypeAzureActiveDirectory AuthenticationType = "AzureActiveDirectory" + AuthenticationTypeInvalid AuthenticationType = "Invalid" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeAzureActiveDirectory), + string(AuthenticationTypeInvalid), + } +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "azureactivedirectory": AuthenticationTypeAzureActiveDirectory, + "invalid": AuthenticationTypeInvalid, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type DataBoxEdgeDeviceKind string + +const ( + DataBoxEdgeDeviceKindAzureDataBoxGateway DataBoxEdgeDeviceKind = "AzureDataBoxGateway" + DataBoxEdgeDeviceKindAzureModularDataCentre DataBoxEdgeDeviceKind = "AzureModularDataCentre" + DataBoxEdgeDeviceKindAzureStackEdge DataBoxEdgeDeviceKind = "AzureStackEdge" + DataBoxEdgeDeviceKindAzureStackHub DataBoxEdgeDeviceKind = "AzureStackHub" +) + +func PossibleValuesForDataBoxEdgeDeviceKind() []string { + return []string{ + string(DataBoxEdgeDeviceKindAzureDataBoxGateway), + string(DataBoxEdgeDeviceKindAzureModularDataCentre), + string(DataBoxEdgeDeviceKindAzureStackEdge), + string(DataBoxEdgeDeviceKindAzureStackHub), + } +} + +func parseDataBoxEdgeDeviceKind(input string) (*DataBoxEdgeDeviceKind, error) { + vals := map[string]DataBoxEdgeDeviceKind{ + "azuredataboxgateway": DataBoxEdgeDeviceKindAzureDataBoxGateway, + "azuremodulardatacentre": DataBoxEdgeDeviceKindAzureModularDataCentre, + "azurestackedge": DataBoxEdgeDeviceKindAzureStackEdge, + "azurestackhub": DataBoxEdgeDeviceKindAzureStackHub, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DataBoxEdgeDeviceKind(input) + return &out, nil +} + +type DataBoxEdgeDeviceStatus string + +const ( + DataBoxEdgeDeviceStatusDisconnected DataBoxEdgeDeviceStatus = "Disconnected" + DataBoxEdgeDeviceStatusMaintenance DataBoxEdgeDeviceStatus = "Maintenance" + DataBoxEdgeDeviceStatusNeedsAttention DataBoxEdgeDeviceStatus = "NeedsAttention" + DataBoxEdgeDeviceStatusOffline DataBoxEdgeDeviceStatus = "Offline" + DataBoxEdgeDeviceStatusOnline DataBoxEdgeDeviceStatus = "Online" + DataBoxEdgeDeviceStatusPartiallyDisconnected DataBoxEdgeDeviceStatus = "PartiallyDisconnected" + DataBoxEdgeDeviceStatusReadyToSetup DataBoxEdgeDeviceStatus = "ReadyToSetup" +) + +func PossibleValuesForDataBoxEdgeDeviceStatus() []string { + return []string{ + string(DataBoxEdgeDeviceStatusDisconnected), + string(DataBoxEdgeDeviceStatusMaintenance), + string(DataBoxEdgeDeviceStatusNeedsAttention), + string(DataBoxEdgeDeviceStatusOffline), + string(DataBoxEdgeDeviceStatusOnline), + string(DataBoxEdgeDeviceStatusPartiallyDisconnected), + string(DataBoxEdgeDeviceStatusReadyToSetup), + } +} + +func parseDataBoxEdgeDeviceStatus(input string) (*DataBoxEdgeDeviceStatus, error) { + vals := map[string]DataBoxEdgeDeviceStatus{ + "disconnected": DataBoxEdgeDeviceStatusDisconnected, + "maintenance": DataBoxEdgeDeviceStatusMaintenance, + "needsattention": DataBoxEdgeDeviceStatusNeedsAttention, + "offline": DataBoxEdgeDeviceStatusOffline, + "online": DataBoxEdgeDeviceStatusOnline, + "partiallydisconnected": DataBoxEdgeDeviceStatusPartiallyDisconnected, + "readytosetup": DataBoxEdgeDeviceStatusReadyToSetup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DataBoxEdgeDeviceStatus(input) + return &out, nil +} + +type DeviceType string + +const ( + DeviceTypeDataBoxEdgeDevice DeviceType = "DataBoxEdgeDevice" +) + +func PossibleValuesForDeviceType() []string { + return []string{ + string(DeviceTypeDataBoxEdgeDevice), + } +} + +func parseDeviceType(input string) (*DeviceType, error) { + vals := map[string]DeviceType{ + "databoxedgedevice": DeviceTypeDataBoxEdgeDevice, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeviceType(input) + return &out, nil +} + +type EncryptionAlgorithm string + +const ( + EncryptionAlgorithmAESTwoFiveSix EncryptionAlgorithm = "AES256" + EncryptionAlgorithmNone EncryptionAlgorithm = "None" + EncryptionAlgorithmRSAESPKCSOneVOneFive EncryptionAlgorithm = "RSAES_PKCS1_v_1_5" +) + +func PossibleValuesForEncryptionAlgorithm() []string { + return []string{ + string(EncryptionAlgorithmAESTwoFiveSix), + string(EncryptionAlgorithmNone), + string(EncryptionAlgorithmRSAESPKCSOneVOneFive), + } +} + +func parseEncryptionAlgorithm(input string) (*EncryptionAlgorithm, error) { + vals := map[string]EncryptionAlgorithm{ + "aes256": EncryptionAlgorithmAESTwoFiveSix, + "none": EncryptionAlgorithmNone, + "rsaes_pkcs1_v_1_5": EncryptionAlgorithmRSAESPKCSOneVOneFive, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EncryptionAlgorithm(input) + return &out, nil +} + +type InstallRebootBehavior string + +const ( + InstallRebootBehaviorNeverReboots InstallRebootBehavior = "NeverReboots" + InstallRebootBehaviorRequestReboot InstallRebootBehavior = "RequestReboot" + InstallRebootBehaviorRequiresReboot InstallRebootBehavior = "RequiresReboot" +) + +func PossibleValuesForInstallRebootBehavior() []string { + return []string{ + string(InstallRebootBehaviorNeverReboots), + string(InstallRebootBehaviorRequestReboot), + string(InstallRebootBehaviorRequiresReboot), + } +} + +func parseInstallRebootBehavior(input string) (*InstallRebootBehavior, error) { + vals := map[string]InstallRebootBehavior{ + "neverreboots": InstallRebootBehaviorNeverReboots, + "requestreboot": InstallRebootBehaviorRequestReboot, + "requiresreboot": InstallRebootBehaviorRequiresReboot, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := InstallRebootBehavior(input) + return &out, nil +} + +type KeyVaultSyncStatus string + +const ( + KeyVaultSyncStatusKeyVaultNotConfigured KeyVaultSyncStatus = "KeyVaultNotConfigured" + KeyVaultSyncStatusKeyVaultSyncFailed KeyVaultSyncStatus = "KeyVaultSyncFailed" + KeyVaultSyncStatusKeyVaultSyncPending KeyVaultSyncStatus = "KeyVaultSyncPending" + KeyVaultSyncStatusKeyVaultSynced KeyVaultSyncStatus = "KeyVaultSynced" + KeyVaultSyncStatusKeyVaultSyncing KeyVaultSyncStatus = "KeyVaultSyncing" +) + +func PossibleValuesForKeyVaultSyncStatus() []string { + return []string{ + string(KeyVaultSyncStatusKeyVaultNotConfigured), + string(KeyVaultSyncStatusKeyVaultSyncFailed), + string(KeyVaultSyncStatusKeyVaultSyncPending), + string(KeyVaultSyncStatusKeyVaultSynced), + string(KeyVaultSyncStatusKeyVaultSyncing), + } +} + +func parseKeyVaultSyncStatus(input string) (*KeyVaultSyncStatus, error) { + vals := map[string]KeyVaultSyncStatus{ + "keyvaultnotconfigured": KeyVaultSyncStatusKeyVaultNotConfigured, + "keyvaultsyncfailed": KeyVaultSyncStatusKeyVaultSyncFailed, + "keyvaultsyncpending": KeyVaultSyncStatusKeyVaultSyncPending, + "keyvaultsynced": KeyVaultSyncStatusKeyVaultSynced, + "keyvaultsyncing": KeyVaultSyncStatusKeyVaultSyncing, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := KeyVaultSyncStatus(input) + return &out, nil +} + +type MsiIdentityType string + +const ( + MsiIdentityTypeNone MsiIdentityType = "None" + MsiIdentityTypeSystemAssigned MsiIdentityType = "SystemAssigned" + MsiIdentityTypeUserAssigned MsiIdentityType = "UserAssigned" +) + +func PossibleValuesForMsiIdentityType() []string { + return []string{ + string(MsiIdentityTypeNone), + string(MsiIdentityTypeSystemAssigned), + string(MsiIdentityTypeUserAssigned), + } +} + +func parseMsiIdentityType(input string) (*MsiIdentityType, error) { + vals := map[string]MsiIdentityType{ + "none": MsiIdentityTypeNone, + "systemassigned": MsiIdentityTypeSystemAssigned, + "userassigned": MsiIdentityTypeUserAssigned, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MsiIdentityType(input) + return &out, nil +} + +type NetworkAdapterDHCPStatus string + +const ( + NetworkAdapterDHCPStatusDisabled NetworkAdapterDHCPStatus = "Disabled" + NetworkAdapterDHCPStatusEnabled NetworkAdapterDHCPStatus = "Enabled" +) + +func PossibleValuesForNetworkAdapterDHCPStatus() []string { + return []string{ + string(NetworkAdapterDHCPStatusDisabled), + string(NetworkAdapterDHCPStatusEnabled), + } +} + +func parseNetworkAdapterDHCPStatus(input string) (*NetworkAdapterDHCPStatus, error) { + vals := map[string]NetworkAdapterDHCPStatus{ + "disabled": NetworkAdapterDHCPStatusDisabled, + "enabled": NetworkAdapterDHCPStatusEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkAdapterDHCPStatus(input) + return &out, nil +} + +type NetworkAdapterRDMAStatus string + +const ( + NetworkAdapterRDMAStatusCapable NetworkAdapterRDMAStatus = "Capable" + NetworkAdapterRDMAStatusIncapable NetworkAdapterRDMAStatus = "Incapable" +) + +func PossibleValuesForNetworkAdapterRDMAStatus() []string { + return []string{ + string(NetworkAdapterRDMAStatusCapable), + string(NetworkAdapterRDMAStatusIncapable), + } +} + +func parseNetworkAdapterRDMAStatus(input string) (*NetworkAdapterRDMAStatus, error) { + vals := map[string]NetworkAdapterRDMAStatus{ + "capable": NetworkAdapterRDMAStatusCapable, + "incapable": NetworkAdapterRDMAStatusIncapable, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkAdapterRDMAStatus(input) + return &out, nil +} + +type NetworkAdapterStatus string + +const ( + NetworkAdapterStatusActive NetworkAdapterStatus = "Active" + NetworkAdapterStatusInactive NetworkAdapterStatus = "Inactive" +) + +func PossibleValuesForNetworkAdapterStatus() []string { + return []string{ + string(NetworkAdapterStatusActive), + string(NetworkAdapterStatusInactive), + } +} + +func parseNetworkAdapterStatus(input string) (*NetworkAdapterStatus, error) { + vals := map[string]NetworkAdapterStatus{ + "active": NetworkAdapterStatusActive, + "inactive": NetworkAdapterStatusInactive, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkAdapterStatus(input) + return &out, nil +} + +type NetworkGroup string + +const ( + NetworkGroupNonRDMA NetworkGroup = "NonRDMA" + NetworkGroupNone NetworkGroup = "None" + NetworkGroupRDMA NetworkGroup = "RDMA" +) + +func PossibleValuesForNetworkGroup() []string { + return []string{ + string(NetworkGroupNonRDMA), + string(NetworkGroupNone), + string(NetworkGroupRDMA), + } +} + +func parseNetworkGroup(input string) (*NetworkGroup, error) { + vals := map[string]NetworkGroup{ + "nonrdma": NetworkGroupNonRDMA, + "none": NetworkGroupNone, + "rdma": NetworkGroupRDMA, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkGroup(input) + return &out, nil +} + +type ResourceMoveStatus string + +const ( + ResourceMoveStatusNone ResourceMoveStatus = "None" + ResourceMoveStatusResourceMoveFailed ResourceMoveStatus = "ResourceMoveFailed" + ResourceMoveStatusResourceMoveInProgress ResourceMoveStatus = "ResourceMoveInProgress" +) + +func PossibleValuesForResourceMoveStatus() []string { + return []string{ + string(ResourceMoveStatusNone), + string(ResourceMoveStatusResourceMoveFailed), + string(ResourceMoveStatusResourceMoveInProgress), + } +} + +func parseResourceMoveStatus(input string) (*ResourceMoveStatus, error) { + vals := map[string]ResourceMoveStatus{ + "none": ResourceMoveStatusNone, + "resourcemovefailed": ResourceMoveStatusResourceMoveFailed, + "resourcemoveinprogress": ResourceMoveStatusResourceMoveInProgress, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceMoveStatus(input) + return &out, nil +} + +type RoleTypes string + +const ( + RoleTypesASA RoleTypes = "ASA" + RoleTypesCloudEdgeManagement RoleTypes = "CloudEdgeManagement" + RoleTypesCognitive RoleTypes = "Cognitive" + RoleTypesFunctions RoleTypes = "Functions" + RoleTypesIOT RoleTypes = "IOT" + RoleTypesKubernetes RoleTypes = "Kubernetes" + RoleTypesMEC RoleTypes = "MEC" +) + +func PossibleValuesForRoleTypes() []string { + return []string{ + string(RoleTypesASA), + string(RoleTypesCloudEdgeManagement), + string(RoleTypesCognitive), + string(RoleTypesFunctions), + string(RoleTypesIOT), + string(RoleTypesKubernetes), + string(RoleTypesMEC), + } +} + +func parseRoleTypes(input string) (*RoleTypes, error) { + vals := map[string]RoleTypes{ + "asa": RoleTypesASA, + "cloudedgemanagement": RoleTypesCloudEdgeManagement, + "cognitive": RoleTypesCognitive, + "functions": RoleTypesFunctions, + "iot": RoleTypesIOT, + "kubernetes": RoleTypesKubernetes, + "mec": RoleTypesMEC, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RoleTypes(input) + return &out, nil +} + +type SkuName string + +const ( + SkuNameEdge SkuName = "Edge" + SkuNameEdgeMRMini SkuName = "EdgeMR_Mini" + SkuNameEdgePBase SkuName = "EdgeP_Base" + SkuNameEdgePHigh SkuName = "EdgeP_High" + SkuNameEdgePRBase SkuName = "EdgePR_Base" + SkuNameEdgePRBaseUPS SkuName = "EdgePR_Base_UPS" + SkuNameGPU SkuName = "GPU" + SkuNameGateway SkuName = "Gateway" + SkuNameRCALarge SkuName = "RCA_Large" + SkuNameRCASmall SkuName = "RCA_Small" + SkuNameRDC SkuName = "RDC" + SkuNameTCALarge SkuName = "TCA_Large" + SkuNameTCASmall SkuName = "TCA_Small" + SkuNameTDC SkuName = "TDC" + SkuNameTEAFourNodeHeater SkuName = "TEA_4Node_Heater" + SkuNameTEAFourNodeUPSHeater SkuName = "TEA_4Node_UPS_Heater" + SkuNameTEAOneNode SkuName = "TEA_1Node" + SkuNameTEAOneNodeHeater SkuName = "TEA_1Node_Heater" + SkuNameTEAOneNodeUPS SkuName = "TEA_1Node_UPS" + SkuNameTEAOneNodeUPSHeater SkuName = "TEA_1Node_UPS_Heater" + SkuNameTMA SkuName = "TMA" +) + +func PossibleValuesForSkuName() []string { + return []string{ + string(SkuNameEdge), + string(SkuNameEdgeMRMini), + string(SkuNameEdgePBase), + string(SkuNameEdgePHigh), + string(SkuNameEdgePRBase), + string(SkuNameEdgePRBaseUPS), + string(SkuNameGPU), + string(SkuNameGateway), + string(SkuNameRCALarge), + string(SkuNameRCASmall), + string(SkuNameRDC), + string(SkuNameTCALarge), + string(SkuNameTCASmall), + string(SkuNameTDC), + string(SkuNameTEAFourNodeHeater), + string(SkuNameTEAFourNodeUPSHeater), + string(SkuNameTEAOneNode), + string(SkuNameTEAOneNodeHeater), + string(SkuNameTEAOneNodeUPS), + string(SkuNameTEAOneNodeUPSHeater), + string(SkuNameTMA), + } +} + +func parseSkuName(input string) (*SkuName, error) { + vals := map[string]SkuName{ + "edge": SkuNameEdge, + "edgemr_mini": SkuNameEdgeMRMini, + "edgep_base": SkuNameEdgePBase, + "edgep_high": SkuNameEdgePHigh, + "edgepr_base": SkuNameEdgePRBase, + "edgepr_base_ups": SkuNameEdgePRBaseUPS, + "gpu": SkuNameGPU, + "gateway": SkuNameGateway, + "rca_large": SkuNameRCALarge, + "rca_small": SkuNameRCASmall, + "rdc": SkuNameRDC, + "tca_large": SkuNameTCALarge, + "tca_small": SkuNameTCASmall, + "tdc": SkuNameTDC, + "tea_4node_heater": SkuNameTEAFourNodeHeater, + "tea_4node_ups_heater": SkuNameTEAFourNodeUPSHeater, + "tea_1node": SkuNameTEAOneNode, + "tea_1node_heater": SkuNameTEAOneNodeHeater, + "tea_1node_ups": SkuNameTEAOneNodeUPS, + "tea_1node_ups_heater": SkuNameTEAOneNodeUPSHeater, + "tma": SkuNameTMA, + } + 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 ( + SkuTierStandard SkuTier = "Standard" +) + +func PossibleValuesForSkuTier() []string { + return []string{ + string(SkuTierStandard), + } +} + +func parseSkuTier(input string) (*SkuTier, error) { + vals := map[string]SkuTier{ + "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 SubscriptionState string + +const ( + SubscriptionStateDeleted SubscriptionState = "Deleted" + SubscriptionStateRegistered SubscriptionState = "Registered" + SubscriptionStateSuspended SubscriptionState = "Suspended" + SubscriptionStateUnregistered SubscriptionState = "Unregistered" + SubscriptionStateWarned SubscriptionState = "Warned" +) + +func PossibleValuesForSubscriptionState() []string { + return []string{ + string(SubscriptionStateDeleted), + string(SubscriptionStateRegistered), + string(SubscriptionStateSuspended), + string(SubscriptionStateUnregistered), + string(SubscriptionStateWarned), + } +} + +func parseSubscriptionState(input string) (*SubscriptionState, error) { + vals := map[string]SubscriptionState{ + "deleted": SubscriptionStateDeleted, + "registered": SubscriptionStateRegistered, + "suspended": SubscriptionStateSuspended, + "unregistered": SubscriptionStateUnregistered, + "warned": SubscriptionStateWarned, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SubscriptionState(input) + return &out, nil +} + +type UpdateOperation string + +const ( + UpdateOperationDownload UpdateOperation = "Download" + UpdateOperationInstall UpdateOperation = "Install" + UpdateOperationNone UpdateOperation = "None" + UpdateOperationScan UpdateOperation = "Scan" +) + +func PossibleValuesForUpdateOperation() []string { + return []string{ + string(UpdateOperationDownload), + string(UpdateOperationInstall), + string(UpdateOperationNone), + string(UpdateOperationScan), + } +} + +func parseUpdateOperation(input string) (*UpdateOperation, error) { + vals := map[string]UpdateOperation{ + "download": UpdateOperationDownload, + "install": UpdateOperationInstall, + "none": UpdateOperationNone, + "scan": UpdateOperationScan, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateOperation(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/id_databoxedgedevice.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/id_databoxedgedevice.go new file mode 100644 index 000000000000..8bada0ba5719 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/id_databoxedgedevice.go @@ -0,0 +1,124 @@ +package devices + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = DataBoxEdgeDeviceId{} + +// DataBoxEdgeDeviceId is a struct representing the Resource ID for a Data Box Edge Device +type DataBoxEdgeDeviceId struct { + SubscriptionId string + ResourceGroupName string + DataBoxEdgeDeviceName string +} + +// NewDataBoxEdgeDeviceID returns a new DataBoxEdgeDeviceId struct +func NewDataBoxEdgeDeviceID(subscriptionId string, resourceGroupName string, dataBoxEdgeDeviceName string) DataBoxEdgeDeviceId { + return DataBoxEdgeDeviceId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DataBoxEdgeDeviceName: dataBoxEdgeDeviceName, + } +} + +// ParseDataBoxEdgeDeviceID parses 'input' into a DataBoxEdgeDeviceId +func ParseDataBoxEdgeDeviceID(input string) (*DataBoxEdgeDeviceId, error) { + parser := resourceids.NewParserFromResourceIdType(DataBoxEdgeDeviceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DataBoxEdgeDeviceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DataBoxEdgeDeviceName, ok = parsed.Parsed["dataBoxEdgeDeviceName"]; !ok { + return nil, fmt.Errorf("the segment 'dataBoxEdgeDeviceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseDataBoxEdgeDeviceIDInsensitively parses 'input' case-insensitively into a DataBoxEdgeDeviceId +// note: this method should only be used for API response data and not user input +func ParseDataBoxEdgeDeviceIDInsensitively(input string) (*DataBoxEdgeDeviceId, error) { + parser := resourceids.NewParserFromResourceIdType(DataBoxEdgeDeviceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DataBoxEdgeDeviceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.DataBoxEdgeDeviceName, ok = parsed.Parsed["dataBoxEdgeDeviceName"]; !ok { + return nil, fmt.Errorf("the segment 'dataBoxEdgeDeviceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateDataBoxEdgeDeviceID checks that 'input' can be parsed as a Data Box Edge Device ID +func ValidateDataBoxEdgeDeviceID(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 := ParseDataBoxEdgeDeviceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Data Box Edge Device ID +func (id DataBoxEdgeDeviceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DataBoxEdgeDeviceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Data Box Edge Device ID +func (id DataBoxEdgeDeviceId) 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("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), + resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceValue"), + } +} + +// String returns a human-readable description of this Data Box Edge Device ID +func (id DataBoxEdgeDeviceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Data Box Edge Device Name: %q", id.DataBoxEdgeDeviceName), + } + return fmt.Sprintf("Data Box Edge Device (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_createorupdate_autorest.go new file mode 100644 index 000000000000..5f796e884fd8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_createorupdate_autorest.go @@ -0,0 +1,79 @@ +package devices + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// 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 polling.LongRunningPoller + HttpResponse *http.Response +} + +// CreateOrUpdate ... +func (c DevicesClient) CreateOrUpdate(ctx context.Context, id DataBoxEdgeDeviceId, input DataBoxEdgeDevice) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c DevicesClient) CreateOrUpdateThenPoll(ctx context.Context, id DataBoxEdgeDeviceId, input DataBoxEdgeDevice) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c DevicesClient) preparerForCreateOrUpdate(ctx context.Context, id DataBoxEdgeDeviceId, input DataBoxEdgeDevice) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c DevicesClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_createorupdatesecuritysettings_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_createorupdatesecuritysettings_autorest.go new file mode 100644 index 000000000000..f6c16330e22c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_createorupdatesecuritysettings_autorest.go @@ -0,0 +1,79 @@ +package devices + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateSecuritySettingsOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CreateOrUpdateSecuritySettings ... +func (c DevicesClient) CreateOrUpdateSecuritySettings(ctx context.Context, id DataBoxEdgeDeviceId, input SecuritySettings) (result CreateOrUpdateSecuritySettingsOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdateSecuritySettings(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "CreateOrUpdateSecuritySettings", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreateOrUpdateSecuritySettings(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "CreateOrUpdateSecuritySettings", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateOrUpdateSecuritySettingsThenPoll performs CreateOrUpdateSecuritySettings then polls until it's completed +func (c DevicesClient) CreateOrUpdateSecuritySettingsThenPoll(ctx context.Context, id DataBoxEdgeDeviceId, input SecuritySettings) error { + result, err := c.CreateOrUpdateSecuritySettings(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdateSecuritySettings: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CreateOrUpdateSecuritySettings: %+v", err) + } + + return nil +} + +// preparerForCreateOrUpdateSecuritySettings prepares the CreateOrUpdateSecuritySettings request. +func (c DevicesClient) preparerForCreateOrUpdateSecuritySettings(ctx context.Context, id DataBoxEdgeDeviceId, input SecuritySettings) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/securitySettings/default/update", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreateOrUpdateSecuritySettings sends the CreateOrUpdateSecuritySettings request. The method will close the +// http.Response Body if it receives an error. +func (c DevicesClient) senderForCreateOrUpdateSecuritySettings(ctx context.Context, req *http.Request) (future CreateOrUpdateSecuritySettingsOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_delete_autorest.go new file mode 100644 index 000000000000..5a3f7f443826 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_delete_autorest.go @@ -0,0 +1,78 @@ +package devices + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// 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 polling.LongRunningPoller + HttpResponse *http.Response +} + +// Delete ... +func (c DevicesClient) Delete(ctx context.Context, id DataBoxEdgeDeviceId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = c.senderForDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c DevicesClient) DeleteThenPoll(ctx context.Context, id DataBoxEdgeDeviceId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} + +// preparerForDelete prepares the Delete request. +func (c DevicesClient) preparerForDelete(ctx context.Context, id DataBoxEdgeDeviceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDelete sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (c DevicesClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_downloadupdates_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_downloadupdates_autorest.go new file mode 100644 index 000000000000..3b93e29cc873 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_downloadupdates_autorest.go @@ -0,0 +1,78 @@ +package devices + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DownloadUpdatesOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// DownloadUpdates ... +func (c DevicesClient) DownloadUpdates(ctx context.Context, id DataBoxEdgeDeviceId) (result DownloadUpdatesOperationResponse, err error) { + req, err := c.preparerForDownloadUpdates(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "DownloadUpdates", nil, "Failure preparing request") + return + } + + result, err = c.senderForDownloadUpdates(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "DownloadUpdates", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DownloadUpdatesThenPoll performs DownloadUpdates then polls until it's completed +func (c DevicesClient) DownloadUpdatesThenPoll(ctx context.Context, id DataBoxEdgeDeviceId) error { + result, err := c.DownloadUpdates(ctx, id) + if err != nil { + return fmt.Errorf("performing DownloadUpdates: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after DownloadUpdates: %+v", err) + } + + return nil +} + +// preparerForDownloadUpdates prepares the DownloadUpdates request. +func (c DevicesClient) preparerForDownloadUpdates(ctx context.Context, id DataBoxEdgeDeviceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/downloadUpdates", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDownloadUpdates sends the DownloadUpdates request. The method will close the +// http.Response Body if it receives an error. +func (c DevicesClient) senderForDownloadUpdates(ctx context.Context, req *http.Request) (future DownloadUpdatesOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_generatecertificate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_generatecertificate_autorest.go new file mode 100644 index 000000000000..30fcffc6d248 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_generatecertificate_autorest.go @@ -0,0 +1,69 @@ +package devices + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GenerateCertificateOperationResponse struct { + HttpResponse *http.Response + Model *GenerateCertResponse +} + +// GenerateCertificate ... +func (c DevicesClient) GenerateCertificate(ctx context.Context, id DataBoxEdgeDeviceId) (result GenerateCertificateOperationResponse, err error) { + req, err := c.preparerForGenerateCertificate(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "GenerateCertificate", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "GenerateCertificate", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGenerateCertificate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "GenerateCertificate", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGenerateCertificate prepares the GenerateCertificate request. +func (c DevicesClient) preparerForGenerateCertificate(ctx context.Context, id DataBoxEdgeDeviceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/generateCertificate", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGenerateCertificate handles the response to the GenerateCertificate request. The method always +// closes the http.Response Body. +func (c DevicesClient) responderForGenerateCertificate(resp *http.Response) (result GenerateCertificateOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_get_autorest.go new file mode 100644 index 000000000000..d34b27527c8e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_get_autorest.go @@ -0,0 +1,68 @@ +package devices + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *DataBoxEdgeDevice +} + +// Get ... +func (c DevicesClient) Get(ctx context.Context, id DataBoxEdgeDeviceId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c DevicesClient) preparerForGet(ctx context.Context, id DataBoxEdgeDeviceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c DevicesClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_getextendedinformation_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_getextendedinformation_autorest.go new file mode 100644 index 000000000000..372a3c497720 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_getextendedinformation_autorest.go @@ -0,0 +1,69 @@ +package devices + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetExtendedInformationOperationResponse struct { + HttpResponse *http.Response + Model *DataBoxEdgeDeviceExtendedInfo +} + +// GetExtendedInformation ... +func (c DevicesClient) GetExtendedInformation(ctx context.Context, id DataBoxEdgeDeviceId) (result GetExtendedInformationOperationResponse, err error) { + req, err := c.preparerForGetExtendedInformation(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "GetExtendedInformation", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "GetExtendedInformation", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGetExtendedInformation(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "GetExtendedInformation", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGetExtendedInformation prepares the GetExtendedInformation request. +func (c DevicesClient) preparerForGetExtendedInformation(ctx context.Context, id DataBoxEdgeDeviceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/getExtendedInformation", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGetExtendedInformation handles the response to the GetExtendedInformation request. The method always +// closes the http.Response Body. +func (c DevicesClient) responderForGetExtendedInformation(resp *http.Response) (result GetExtendedInformationOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_getnetworksettings_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_getnetworksettings_autorest.go new file mode 100644 index 000000000000..24ca3c85f68b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_getnetworksettings_autorest.go @@ -0,0 +1,69 @@ +package devices + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetNetworkSettingsOperationResponse struct { + HttpResponse *http.Response + Model *NetworkSettings +} + +// GetNetworkSettings ... +func (c DevicesClient) GetNetworkSettings(ctx context.Context, id DataBoxEdgeDeviceId) (result GetNetworkSettingsOperationResponse, err error) { + req, err := c.preparerForGetNetworkSettings(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "GetNetworkSettings", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "GetNetworkSettings", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGetNetworkSettings(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "GetNetworkSettings", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGetNetworkSettings prepares the GetNetworkSettings request. +func (c DevicesClient) preparerForGetNetworkSettings(ctx context.Context, id DataBoxEdgeDeviceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/networkSettings/default", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGetNetworkSettings handles the response to the GetNetworkSettings request. The method always +// closes the http.Response Body. +func (c DevicesClient) responderForGetNetworkSettings(resp *http.Response) (result GetNetworkSettingsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_getupdatesummary_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_getupdatesummary_autorest.go new file mode 100644 index 000000000000..7dc56e38d2dd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_getupdatesummary_autorest.go @@ -0,0 +1,69 @@ +package devices + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUpdateSummaryOperationResponse struct { + HttpResponse *http.Response + Model *UpdateSummary +} + +// GetUpdateSummary ... +func (c DevicesClient) GetUpdateSummary(ctx context.Context, id DataBoxEdgeDeviceId) (result GetUpdateSummaryOperationResponse, err error) { + req, err := c.preparerForGetUpdateSummary(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "GetUpdateSummary", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "GetUpdateSummary", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGetUpdateSummary(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "GetUpdateSummary", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGetUpdateSummary prepares the GetUpdateSummary request. +func (c DevicesClient) preparerForGetUpdateSummary(ctx context.Context, id DataBoxEdgeDeviceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/updateSummary/default", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGetUpdateSummary handles the response to the GetUpdateSummary request. The method always +// closes the http.Response Body. +func (c DevicesClient) responderForGetUpdateSummary(resp *http.Response) (result GetUpdateSummaryOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_installupdates_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_installupdates_autorest.go new file mode 100644 index 000000000000..fc7f017162eb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_installupdates_autorest.go @@ -0,0 +1,78 @@ +package devices + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InstallUpdatesOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// InstallUpdates ... +func (c DevicesClient) InstallUpdates(ctx context.Context, id DataBoxEdgeDeviceId) (result InstallUpdatesOperationResponse, err error) { + req, err := c.preparerForInstallUpdates(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "InstallUpdates", nil, "Failure preparing request") + return + } + + result, err = c.senderForInstallUpdates(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "InstallUpdates", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// InstallUpdatesThenPoll performs InstallUpdates then polls until it's completed +func (c DevicesClient) InstallUpdatesThenPoll(ctx context.Context, id DataBoxEdgeDeviceId) error { + result, err := c.InstallUpdates(ctx, id) + if err != nil { + return fmt.Errorf("performing InstallUpdates: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after InstallUpdates: %+v", err) + } + + return nil +} + +// preparerForInstallUpdates prepares the InstallUpdates request. +func (c DevicesClient) preparerForInstallUpdates(ctx context.Context, id DataBoxEdgeDeviceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/installUpdates", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForInstallUpdates sends the InstallUpdates request. The method will close the +// http.Response Body if it receives an error. +func (c DevicesClient) senderForInstallUpdates(ctx context.Context, req *http.Request) (future InstallUpdatesOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_listbyresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_listbyresourcegroup_autorest.go new file mode 100644 index 000000000000..68d9bf2d387e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_listbyresourcegroup_autorest.go @@ -0,0 +1,216 @@ +package devices + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + Model *[]DataBoxEdgeDevice + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListByResourceGroupOperationResponse, error) +} + +type ListByResourceGroupCompleteResult struct { + Items []DataBoxEdgeDevice +} + +func (r ListByResourceGroupOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListByResourceGroupOperationResponse) LoadMore(ctx context.Context) (resp ListByResourceGroupOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +type ListByResourceGroupOperationOptions struct { + Expand *string +} + +func DefaultListByResourceGroupOperationOptions() ListByResourceGroupOperationOptions { + return ListByResourceGroupOperationOptions{} +} + +func (o ListByResourceGroupOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o ListByResourceGroupOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Expand != nil { + out["$expand"] = *o.Expand + } + + return out +} + +// ListByResourceGroup ... +func (c DevicesClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (resp ListByResourceGroupOperationResponse, err error) { + req, err := c.preparerForListByResourceGroup(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "ListByResourceGroup", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForListByResourceGroup(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "ListByResourceGroup", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForListByResourceGroup prepares the ListByResourceGroup request. +func (c DevicesClient) preparerForListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListByResourceGroupWithNextLink prepares the ListByResourceGroup request with the given nextLink token. +func (c DevicesClient) preparerForListByResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListByResourceGroup handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (c DevicesClient) responderForListByResourceGroup(resp *http.Response) (result ListByResourceGroupOperationResponse, err error) { + type page struct { + Values []DataBoxEdgeDevice `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByResourceGroupOperationResponse, err error) { + req, err := c.preparerForListByResourceGroupWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "ListByResourceGroup", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListByResourceGroup(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "ListByResourceGroup", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListByResourceGroupComplete retrieves all of the results into a single object +func (c DevicesClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, options, DataBoxEdgeDeviceOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c DevicesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions, predicate DataBoxEdgeDeviceOperationPredicate) (resp ListByResourceGroupCompleteResult, err error) { + items := make([]DataBoxEdgeDevice, 0) + + page, err := c.ListByResourceGroup(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListByResourceGroupCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_listbysubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_listbysubscription_autorest.go new file mode 100644 index 000000000000..2b8f3b5974d9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_listbysubscription_autorest.go @@ -0,0 +1,216 @@ +package devices + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + Model *[]DataBoxEdgeDevice + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListBySubscriptionOperationResponse, error) +} + +type ListBySubscriptionCompleteResult struct { + Items []DataBoxEdgeDevice +} + +func (r ListBySubscriptionOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListBySubscriptionOperationResponse) LoadMore(ctx context.Context) (resp ListBySubscriptionOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +type ListBySubscriptionOperationOptions struct { + Expand *string +} + +func DefaultListBySubscriptionOperationOptions() ListBySubscriptionOperationOptions { + return ListBySubscriptionOperationOptions{} +} + +func (o ListBySubscriptionOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o ListBySubscriptionOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Expand != nil { + out["$expand"] = *o.Expand + } + + return out +} + +// ListBySubscription ... +func (c DevicesClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (resp ListBySubscriptionOperationResponse, err error) { + req, err := c.preparerForListBySubscription(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "ListBySubscription", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForListBySubscription(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "ListBySubscription", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForListBySubscription prepares the ListBySubscription request. +func (c DevicesClient) preparerForListBySubscription(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListBySubscriptionWithNextLink prepares the ListBySubscription request with the given nextLink token. +func (c DevicesClient) preparerForListBySubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListBySubscription handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (c DevicesClient) responderForListBySubscription(resp *http.Response) (result ListBySubscriptionOperationResponse, err error) { + type page struct { + Values []DataBoxEdgeDevice `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListBySubscriptionOperationResponse, err error) { + req, err := c.preparerForListBySubscriptionWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "ListBySubscription", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListBySubscription(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "ListBySubscription", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListBySubscriptionComplete retrieves all of the results into a single object +func (c DevicesClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, options, DataBoxEdgeDeviceOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c DevicesClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions, predicate DataBoxEdgeDeviceOperationPredicate) (resp ListBySubscriptionCompleteResult, err error) { + items := make([]DataBoxEdgeDevice, 0) + + page, err := c.ListBySubscription(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListBySubscriptionCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_scanforupdates_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_scanforupdates_autorest.go new file mode 100644 index 000000000000..598d063669fd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_scanforupdates_autorest.go @@ -0,0 +1,78 @@ +package devices + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScanForUpdatesOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// ScanForUpdates ... +func (c DevicesClient) ScanForUpdates(ctx context.Context, id DataBoxEdgeDeviceId) (result ScanForUpdatesOperationResponse, err error) { + req, err := c.preparerForScanForUpdates(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "ScanForUpdates", nil, "Failure preparing request") + return + } + + result, err = c.senderForScanForUpdates(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "ScanForUpdates", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// ScanForUpdatesThenPoll performs ScanForUpdates then polls until it's completed +func (c DevicesClient) ScanForUpdatesThenPoll(ctx context.Context, id DataBoxEdgeDeviceId) error { + result, err := c.ScanForUpdates(ctx, id) + if err != nil { + return fmt.Errorf("performing ScanForUpdates: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after ScanForUpdates: %+v", err) + } + + return nil +} + +// preparerForScanForUpdates prepares the ScanForUpdates request. +func (c DevicesClient) preparerForScanForUpdates(ctx context.Context, id DataBoxEdgeDeviceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/scanForUpdates", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForScanForUpdates sends the ScanForUpdates request. The method will close the +// http.Response Body if it receives an error. +func (c DevicesClient) senderForScanForUpdates(ctx context.Context, req *http.Request) (future ScanForUpdatesOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_update_autorest.go new file mode 100644 index 000000000000..aba7ee2d2976 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_update_autorest.go @@ -0,0 +1,69 @@ +package devices + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + HttpResponse *http.Response + Model *DataBoxEdgeDevice +} + +// Update ... +func (c DevicesClient) Update(ctx context.Context, id DataBoxEdgeDeviceId, input DataBoxEdgeDevicePatch) (result UpdateOperationResponse, err error) { + req, err := c.preparerForUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "Update", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "Update", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForUpdate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "Update", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForUpdate prepares the Update request. +func (c DevicesClient) preparerForUpdate(ctx context.Context, id DataBoxEdgeDeviceId, input DataBoxEdgeDevicePatch) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForUpdate handles the response to the Update request. The method always +// closes the http.Response Body. +func (c DevicesClient) responderForUpdate(resp *http.Response) (result UpdateOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_updateextendedinformation_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_updateextendedinformation_autorest.go new file mode 100644 index 000000000000..10d3b954e678 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_updateextendedinformation_autorest.go @@ -0,0 +1,70 @@ +package devices + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateExtendedInformationOperationResponse struct { + HttpResponse *http.Response + Model *DataBoxEdgeDeviceExtendedInfo +} + +// UpdateExtendedInformation ... +func (c DevicesClient) UpdateExtendedInformation(ctx context.Context, id DataBoxEdgeDeviceId, input DataBoxEdgeDeviceExtendedInfoPatch) (result UpdateExtendedInformationOperationResponse, err error) { + req, err := c.preparerForUpdateExtendedInformation(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "UpdateExtendedInformation", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "UpdateExtendedInformation", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForUpdateExtendedInformation(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "UpdateExtendedInformation", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForUpdateExtendedInformation prepares the UpdateExtendedInformation request. +func (c DevicesClient) preparerForUpdateExtendedInformation(ctx context.Context, id DataBoxEdgeDeviceId, input DataBoxEdgeDeviceExtendedInfoPatch) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/updateExtendedInformation", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForUpdateExtendedInformation handles the response to the UpdateExtendedInformation request. The method always +// closes the http.Response Body. +func (c DevicesClient) responderForUpdateExtendedInformation(resp *http.Response) (result UpdateExtendedInformationOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_uploadcertificate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_uploadcertificate_autorest.go new file mode 100644 index 000000000000..9bb8df890b0f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/method_uploadcertificate_autorest.go @@ -0,0 +1,70 @@ +package devices + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UploadCertificateOperationResponse struct { + HttpResponse *http.Response + Model *UploadCertificateResponse +} + +// UploadCertificate ... +func (c DevicesClient) UploadCertificate(ctx context.Context, id DataBoxEdgeDeviceId, input UploadCertificateRequest) (result UploadCertificateOperationResponse, err error) { + req, err := c.preparerForUploadCertificate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "UploadCertificate", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "UploadCertificate", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForUploadCertificate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.DevicesClient", "UploadCertificate", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForUploadCertificate prepares the UploadCertificate request. +func (c DevicesClient) preparerForUploadCertificate(ctx context.Context, id DataBoxEdgeDeviceId, input UploadCertificateRequest) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/uploadCertificate", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForUploadCertificate handles the response to the UploadCertificate request. The method always +// closes the http.Response Body. +func (c DevicesClient) responderForUploadCertificate(resp *http.Response) (result UploadCertificateOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_asymmetricencryptedsecret.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_asymmetricencryptedsecret.go new file mode 100644 index 000000000000..d1ec0525b0b5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_asymmetricencryptedsecret.go @@ -0,0 +1,10 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AsymmetricEncryptedSecret struct { + EncryptionAlgorithm EncryptionAlgorithm `json:"encryptionAlgorithm"` + EncryptionCertThumbprint *string `json:"encryptionCertThumbprint,omitempty"` + Value string `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedevice.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedevice.go new file mode 100644 index 000000000000..99a68326f8b5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedevice.go @@ -0,0 +1,22 @@ +package devices + +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 DataBoxEdgeDevice struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Identity *ResourceIdentity `json:"identity,omitempty"` + Kind *DataBoxEdgeDeviceKind `json:"kind,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *DataBoxEdgeDeviceProperties `json:"properties,omitempty"` + Sku *Sku `json:"sku,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/databoxedge/2020-12-01/devices/model_databoxedgedeviceextendedinfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceextendedinfo.go new file mode 100644 index 000000000000..6c49a4b30ec3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceextendedinfo.go @@ -0,0 +1,11 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataBoxEdgeDeviceExtendedInfo struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *DataBoxEdgeDeviceExtendedInfoProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceextendedinfopatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceextendedinfopatch.go new file mode 100644 index 000000000000..2c17a01f3220 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceextendedinfopatch.go @@ -0,0 +1,12 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataBoxEdgeDeviceExtendedInfoPatch struct { + ChannelIntegrityKeyName *string `json:"channelIntegrityKeyName,omitempty"` + ChannelIntegrityKeyVersion *string `json:"channelIntegrityKeyVersion,omitempty"` + ClientSecretStoreId *string `json:"clientSecretStoreId,omitempty"` + ClientSecretStoreUrl *string `json:"clientSecretStoreUrl,omitempty"` + SyncStatus *KeyVaultSyncStatus `json:"syncStatus,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceextendedinfoproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceextendedinfoproperties.go new file mode 100644 index 000000000000..44f775a0bb24 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceextendedinfoproperties.go @@ -0,0 +1,16 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataBoxEdgeDeviceExtendedInfoProperties struct { + ChannelIntegrityKeyName *string `json:"channelIntegrityKeyName,omitempty"` + ChannelIntegrityKeyVersion *string `json:"channelIntegrityKeyVersion,omitempty"` + ClientSecretStoreId *string `json:"clientSecretStoreId,omitempty"` + ClientSecretStoreUrl *string `json:"clientSecretStoreUrl,omitempty"` + DeviceSecrets *DeviceSecrets `json:"deviceSecrets,omitempty"` + EncryptionKey *string `json:"encryptionKey,omitempty"` + EncryptionKeyThumbprint *string `json:"encryptionKeyThumbprint,omitempty"` + KeyVaultSyncStatus *KeyVaultSyncStatus `json:"keyVaultSyncStatus,omitempty"` + ResourceKey *string `json:"resourceKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedevicepatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedevicepatch.go new file mode 100644 index 000000000000..c28e38455d14 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedevicepatch.go @@ -0,0 +1,10 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataBoxEdgeDevicePatch struct { + Identity *ResourceIdentity `json:"identity,omitempty"` + Properties *DataBoxEdgeDevicePropertiesPatch `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceproperties.go new file mode 100644 index 000000000000..34d90011d171 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedeviceproperties.go @@ -0,0 +1,23 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataBoxEdgeDeviceProperties struct { + ConfiguredRoleTypes *[]RoleTypes `json:"configuredRoleTypes,omitempty"` + Culture *string `json:"culture,omitempty"` + DataBoxEdgeDeviceStatus *DataBoxEdgeDeviceStatus `json:"dataBoxEdgeDeviceStatus,omitempty"` + Description *string `json:"description,omitempty"` + DeviceHcsVersion *string `json:"deviceHcsVersion,omitempty"` + DeviceLocalCapacity *int64 `json:"deviceLocalCapacity,omitempty"` + DeviceModel *string `json:"deviceModel,omitempty"` + DeviceSoftwareVersion *string `json:"deviceSoftwareVersion,omitempty"` + DeviceType *DeviceType `json:"deviceType,omitempty"` + EdgeProfile *EdgeProfile `json:"edgeProfile,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ModelDescription *string `json:"modelDescription,omitempty"` + NodeCount *int64 `json:"nodeCount,omitempty"` + ResourceMoveDetails *ResourceMoveDetails `json:"resourceMoveDetails,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + TimeZone *string `json:"timeZone,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedevicepropertiespatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedevicepropertiespatch.go new file mode 100644 index 000000000000..0a6ff9151c5e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_databoxedgedevicepropertiespatch.go @@ -0,0 +1,8 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataBoxEdgeDevicePropertiesPatch struct { + EdgeProfile *EdgeProfilePatch `json:"edgeProfile,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_devicesecrets.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_devicesecrets.go new file mode 100644 index 000000000000..fc73c4f745d3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_devicesecrets.go @@ -0,0 +1,15 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeviceSecrets struct { + BmcDefaultUserPassword *Secret `json:"bmcDefaultUserPassword,omitempty"` + HcsDataVolumeBitLockerExternalKey *Secret `json:"hcsDataVolumeBitLockerExternalKey,omitempty"` + HcsInternalVolumeBitLockerExternalKey *Secret `json:"hcsInternalVolumeBitLockerExternalKey,omitempty"` + RotateKeyForDataVolumeBitlocker *Secret `json:"rotateKeyForDataVolumeBitlocker,omitempty"` + RotateKeysForSedDrivesSerialized *Secret `json:"rotateKeysForSedDrivesSerialized,omitempty"` + SedEncryptionExternalKey *Secret `json:"sedEncryptionExternalKey,omitempty"` + SedEncryptionExternalKeyId *Secret `json:"sedEncryptionExternalKeyId,omitempty"` + SystemVolumeBitLockerRecoveryKey *Secret `json:"systemVolumeBitLockerRecoveryKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofile.go new file mode 100644 index 000000000000..792b2c13ab7f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofile.go @@ -0,0 +1,8 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EdgeProfile struct { + Subscription *EdgeProfileSubscription `json:"subscription,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofilepatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofilepatch.go new file mode 100644 index 000000000000..f32376df4cf3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofilepatch.go @@ -0,0 +1,8 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EdgeProfilePatch struct { + Subscription *EdgeProfileSubscriptionPatch `json:"subscription,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofilesubscription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofilesubscription.go new file mode 100644 index 000000000000..a474ef8ec365 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofilesubscription.go @@ -0,0 +1,13 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EdgeProfileSubscription struct { + Id *string `json:"id,omitempty"` + Properties *SubscriptionProperties `json:"properties,omitempty"` + RegistrationDate *string `json:"registrationDate,omitempty"` + RegistrationId *string `json:"registrationId,omitempty"` + State *SubscriptionState `json:"state,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofilesubscriptionpatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofilesubscriptionpatch.go new file mode 100644 index 000000000000..27ef0dbe3fd1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_edgeprofilesubscriptionpatch.go @@ -0,0 +1,8 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EdgeProfileSubscriptionPatch struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_generatecertresponse.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_generatecertresponse.go new file mode 100644 index 000000000000..b35f03fef404 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_generatecertresponse.go @@ -0,0 +1,10 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GenerateCertResponse struct { + ExpiryTimeInUTC *string `json:"expiryTimeInUTC,omitempty"` + PrivateKey *string `json:"privateKey,omitempty"` + PublicKey *string `json:"publicKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_ipv4config.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_ipv4config.go new file mode 100644 index 000000000000..6b0bb05e7ea2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_ipv4config.go @@ -0,0 +1,10 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPv4Config struct { + Gateway *string `json:"gateway,omitempty"` + IPAddress *string `json:"ipAddress,omitempty"` + Subnet *string `json:"subnet,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_ipv6config.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_ipv6config.go new file mode 100644 index 000000000000..990814d1599c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_ipv6config.go @@ -0,0 +1,10 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPv6Config struct { + Gateway *string `json:"gateway,omitempty"` + IPAddress *string `json:"ipAddress,omitempty"` + PrefixLength *int64 `json:"prefixLength,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networkadapter.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networkadapter.go new file mode 100644 index 000000000000..2c7ac403d8cd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networkadapter.go @@ -0,0 +1,22 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkAdapter struct { + AdapterId *string `json:"adapterId,omitempty"` + AdapterPosition *NetworkAdapterPosition `json:"adapterPosition,omitempty"` + DhcpStatus *NetworkAdapterDHCPStatus `json:"dhcpStatus,omitempty"` + DnsServers *[]string `json:"dnsServers,omitempty"` + IPv4Configuration *IPv4Config `json:"ipv4Configuration,omitempty"` + IPv6Configuration *IPv6Config `json:"ipv6Configuration,omitempty"` + IPv6LinkLocalAddress *string `json:"ipv6LinkLocalAddress,omitempty"` + Index *int64 `json:"index,omitempty"` + Label *string `json:"label,omitempty"` + LinkSpeed *int64 `json:"linkSpeed,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + NetworkAdapterName *string `json:"networkAdapterName,omitempty"` + NodeId *string `json:"nodeId,omitempty"` + RdmaStatus *NetworkAdapterRDMAStatus `json:"rdmaStatus,omitempty"` + Status *NetworkAdapterStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networkadapterposition.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networkadapterposition.go new file mode 100644 index 000000000000..4be1ed65b706 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networkadapterposition.go @@ -0,0 +1,9 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkAdapterPosition struct { + NetworkGroup *NetworkGroup `json:"networkGroup,omitempty"` + Port *int64 `json:"port,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networksettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networksettings.go new file mode 100644 index 000000000000..b0beabbe36de --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networksettings.go @@ -0,0 +1,11 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkSettings struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *NetworkSettingsProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networksettingsproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networksettingsproperties.go new file mode 100644 index 000000000000..3f9a67bd49cb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_networksettingsproperties.go @@ -0,0 +1,8 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkSettingsProperties struct { + NetworkAdapters *[]NetworkAdapter `json:"networkAdapters,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_rawcertificatedata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_rawcertificatedata.go new file mode 100644 index 000000000000..60057de1e3a0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_rawcertificatedata.go @@ -0,0 +1,9 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RawCertificateData struct { + AuthenticationType *AuthenticationType `json:"authenticationType,omitempty"` + Certificate string `json:"certificate"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_resourceidentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_resourceidentity.go new file mode 100644 index 000000000000..370288e28363 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_resourceidentity.go @@ -0,0 +1,10 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourceIdentity struct { + PrincipalId *string `json:"principalId,omitempty"` + TenantId *string `json:"tenantId,omitempty"` + Type *MsiIdentityType `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_resourcemovedetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_resourcemovedetails.go new file mode 100644 index 000000000000..9b55ef6e42b5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_resourcemovedetails.go @@ -0,0 +1,27 @@ +package devices + +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 ResourceMoveDetails struct { + OperationInProgress *ResourceMoveStatus `json:"operationInProgress,omitempty"` + OperationInProgressLockTimeoutInUTC *string `json:"operationInProgressLockTimeoutInUTC,omitempty"` +} + +func (o *ResourceMoveDetails) GetOperationInProgressLockTimeoutInUTCAsTime() (*time.Time, error) { + if o.OperationInProgressLockTimeoutInUTC == nil { + return nil, nil + } + return dates.ParseAsFormat(o.OperationInProgressLockTimeoutInUTC, "2006-01-02T15:04:05Z07:00") +} + +func (o *ResourceMoveDetails) SetOperationInProgressLockTimeoutInUTCAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.OperationInProgressLockTimeoutInUTC = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_secret.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_secret.go new file mode 100644 index 000000000000..236b469ccac7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_secret.go @@ -0,0 +1,9 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Secret struct { + EncryptedSecret *AsymmetricEncryptedSecret `json:"encryptedSecret,omitempty"` + KeyVaultId *string `json:"keyVaultId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_securitysettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_securitysettings.go new file mode 100644 index 000000000000..905d207dc472 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_securitysettings.go @@ -0,0 +1,11 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecuritySettings struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties SecuritySettingsProperties `json:"properties"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_securitysettingsproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_securitysettingsproperties.go new file mode 100644 index 000000000000..928df627bfa6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_securitysettingsproperties.go @@ -0,0 +1,8 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecuritySettingsProperties struct { + DeviceAdminPassword AsymmetricEncryptedSecret `json:"deviceAdminPassword"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_sku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_sku.go new file mode 100644 index 000000000000..a463a6ccdd85 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_sku.go @@ -0,0 +1,9 @@ +package devices + +// 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,omitempty"` + Tier *SkuTier `json:"tier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_subscriptionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_subscriptionproperties.go new file mode 100644 index 000000000000..b0509965ae86 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_subscriptionproperties.go @@ -0,0 +1,12 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubscriptionProperties struct { + LocationPlacementId *string `json:"locationPlacementId,omitempty"` + QuotaId *string `json:"quotaId,omitempty"` + RegisteredFeatures *[]SubscriptionRegisteredFeatures `json:"registeredFeatures,omitempty"` + SerializedDetails *string `json:"serializedDetails,omitempty"` + TenantId *string `json:"tenantId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_subscriptionregisteredfeatures.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_subscriptionregisteredfeatures.go new file mode 100644 index 000000000000..40309fd9a2c5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_subscriptionregisteredfeatures.go @@ -0,0 +1,9 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubscriptionRegisteredFeatures struct { + Name *string `json:"name,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_updatesummary.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_updatesummary.go new file mode 100644 index 000000000000..9b4494c340a6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_updatesummary.go @@ -0,0 +1,11 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateSummary struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *UpdateSummaryProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_updatesummaryproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_updatesummaryproperties.go new file mode 100644 index 000000000000..a58bcefe7ffc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_updatesummaryproperties.go @@ -0,0 +1,102 @@ +package devices + +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 UpdateSummaryProperties struct { + DeviceLastScannedDateTime *string `json:"deviceLastScannedDateTime,omitempty"` + DeviceVersionNumber *string `json:"deviceVersionNumber,omitempty"` + FriendlyDeviceVersionName *string `json:"friendlyDeviceVersionName,omitempty"` + InProgressDownloadJobId *string `json:"inProgressDownloadJobId,omitempty"` + InProgressDownloadJobStartedDateTime *string `json:"inProgressDownloadJobStartedDateTime,omitempty"` + InProgressInstallJobId *string `json:"inProgressInstallJobId,omitempty"` + InProgressInstallJobStartedDateTime *string `json:"inProgressInstallJobStartedDateTime,omitempty"` + LastCompletedDownloadJobDateTime *string `json:"lastCompletedDownloadJobDateTime,omitempty"` + LastCompletedInstallJobDateTime *string `json:"lastCompletedInstallJobDateTime,omitempty"` + LastCompletedScanJobDateTime *string `json:"lastCompletedScanJobDateTime,omitempty"` + OngoingUpdateOperation *UpdateOperation `json:"ongoingUpdateOperation,omitempty"` + RebootBehavior *InstallRebootBehavior `json:"rebootBehavior,omitempty"` + TotalNumberOfUpdatesAvailable *int64 `json:"totalNumberOfUpdatesAvailable,omitempty"` + TotalNumberOfUpdatesPendingDownload *int64 `json:"totalNumberOfUpdatesPendingDownload,omitempty"` + TotalNumberOfUpdatesPendingInstall *int64 `json:"totalNumberOfUpdatesPendingInstall,omitempty"` + TotalUpdateSizeInBytes *float64 `json:"totalUpdateSizeInBytes,omitempty"` + UpdateTitles *[]string `json:"updateTitles,omitempty"` +} + +func (o *UpdateSummaryProperties) GetDeviceLastScannedDateTimeAsTime() (*time.Time, error) { + if o.DeviceLastScannedDateTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.DeviceLastScannedDateTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *UpdateSummaryProperties) SetDeviceLastScannedDateTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.DeviceLastScannedDateTime = &formatted +} + +func (o *UpdateSummaryProperties) GetInProgressDownloadJobStartedDateTimeAsTime() (*time.Time, error) { + if o.InProgressDownloadJobStartedDateTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.InProgressDownloadJobStartedDateTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *UpdateSummaryProperties) SetInProgressDownloadJobStartedDateTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.InProgressDownloadJobStartedDateTime = &formatted +} + +func (o *UpdateSummaryProperties) GetInProgressInstallJobStartedDateTimeAsTime() (*time.Time, error) { + if o.InProgressInstallJobStartedDateTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.InProgressInstallJobStartedDateTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *UpdateSummaryProperties) SetInProgressInstallJobStartedDateTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.InProgressInstallJobStartedDateTime = &formatted +} + +func (o *UpdateSummaryProperties) GetLastCompletedDownloadJobDateTimeAsTime() (*time.Time, error) { + if o.LastCompletedDownloadJobDateTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastCompletedDownloadJobDateTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *UpdateSummaryProperties) SetLastCompletedDownloadJobDateTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastCompletedDownloadJobDateTime = &formatted +} + +func (o *UpdateSummaryProperties) GetLastCompletedInstallJobDateTimeAsTime() (*time.Time, error) { + if o.LastCompletedInstallJobDateTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastCompletedInstallJobDateTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *UpdateSummaryProperties) SetLastCompletedInstallJobDateTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastCompletedInstallJobDateTime = &formatted +} + +func (o *UpdateSummaryProperties) GetLastCompletedScanJobDateTimeAsTime() (*time.Time, error) { + if o.LastCompletedScanJobDateTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastCompletedScanJobDateTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *UpdateSummaryProperties) SetLastCompletedScanJobDateTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastCompletedScanJobDateTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_uploadcertificaterequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_uploadcertificaterequest.go new file mode 100644 index 000000000000..8d691dff98d3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_uploadcertificaterequest.go @@ -0,0 +1,8 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UploadCertificateRequest struct { + Properties RawCertificateData `json:"properties"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_uploadcertificateresponse.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_uploadcertificateresponse.go new file mode 100644 index 000000000000..1b1155a1e4b4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/model_uploadcertificateresponse.go @@ -0,0 +1,15 @@ +package devices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UploadCertificateResponse struct { + AadAudience *string `json:"aadAudience,omitempty"` + AadAuthority *string `json:"aadAuthority,omitempty"` + AadTenantId *string `json:"aadTenantId,omitempty"` + AuthType *AuthenticationType `json:"authType,omitempty"` + AzureManagementEndpointAudience *string `json:"azureManagementEndpointAudience,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + ServicePrincipalClientId *string `json:"servicePrincipalClientId,omitempty"` + ServicePrincipalObjectId *string `json:"servicePrincipalObjectId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/predicates.go new file mode 100644 index 000000000000..22a79ea9e36c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/predicates.go @@ -0,0 +1,34 @@ +package devices + +type DataBoxEdgeDeviceOperationPredicate struct { + Etag *string + Id *string + Location *string + Name *string + Type *string +} + +func (p DataBoxEdgeDeviceOperationPredicate) Matches(input DataBoxEdgeDevice) bool { + + if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { + return false + } + + 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/databoxedge/2020-12-01/devices/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/version.go new file mode 100644 index 000000000000..d27ea7cc30db --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices/version.go @@ -0,0 +1,12 @@ +package devices + +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 = "2020-12-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/devices/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index c58cf6d61ad8..470af8769efd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -169,7 +169,7 @@ github.com/hashicorp/go-azure-helpers/resourcemanager/zones github.com/hashicorp/go-azure-helpers/resourceproviders github.com/hashicorp/go-azure-helpers/sender github.com/hashicorp/go-azure-helpers/storage -# github.com/hashicorp/go-azure-sdk v0.20230127.1133443 +# github.com/hashicorp/go-azure-sdk v0.20230130.1140358 ## explicit; go 1.18 github.com/hashicorp/go-azure-sdk/resource-manager/aad/2021-05-01/domainservices github.com/hashicorp/go-azure-sdk/resource-manager/aadb2c/2021-04-01-preview @@ -226,6 +226,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exp github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2022-06-01-preview/scheduledactions github.com/hashicorp/go-azure-sdk/resource-manager/customproviders/2018-09-01-preview/customresourceprovider github.com/hashicorp/go-azure-sdk/resource-manager/dashboard/2022-08-01/grafanaresource +github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices github.com/hashicorp/go-azure-sdk/resource-manager/databricks/2022-04-01-preview/accessconnector github.com/hashicorp/go-azure-sdk/resource-manager/databricks/2022-04-01-preview/workspaces github.com/hashicorp/go-azure-sdk/resource-manager/datamigration/2018-04-19/projectresource From 7d93549e1f4132438d31f2d7e04b4f9346060209 Mon Sep 17 00:00:00 2001 From: Steph Date: Tue, 31 Jan 2023 15:23:42 +0100 Subject: [PATCH 2/2] deprecate orders resource --- internal/services/databoxedge/client/client.go | 2 +- .../databoxedge/databox_edge_order_resource.go | 2 ++ .../databoxedge/databox_edge_order_resource_test.go | 13 +++++++++++++ internal/services/databoxedge/registration.go | 8 ++++++-- website/docs/r/databox_edge_order.html.markdown | 2 ++ 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/internal/services/databoxedge/client/client.go b/internal/services/databoxedge/client/client.go index 4ae4e1ef2a73..2f606d8f10ca 100644 --- a/internal/services/databoxedge/client/client.go +++ b/internal/services/databoxedge/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" + "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/databoxedge/databox_edge_order_resource.go b/internal/services/databoxedge/databox_edge_order_resource.go index c76c5dd4413f..12063fad5586 100644 --- a/internal/services/databoxedge/databox_edge_order_resource.go +++ b/internal/services/databoxedge/databox_edge_order_resource.go @@ -23,6 +23,8 @@ func resourceOrder() *pluginsdk.Resource { Update: resourceOrderCreateUpdate, Delete: resourceOrderDelete, + DeprecationMessage: `Creating DataBox Edge Orders are not supported via the Azure API - as such the 'azurerm_databox_edge_order' resource is deprecated and will be removed in v4.0 of the AzureRM Provider`, + Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(30 * time.Minute), Read: pluginsdk.DefaultTimeout(5 * time.Minute), diff --git a/internal/services/databoxedge/databox_edge_order_resource_test.go b/internal/services/databoxedge/databox_edge_order_resource_test.go index 95405323f445..554c0ec9babe 100644 --- a/internal/services/databoxedge/databox_edge_order_resource_test.go +++ b/internal/services/databoxedge/databox_edge_order_resource_test.go @@ -8,6 +8,7 @@ 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/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/databoxedge/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -19,6 +20,10 @@ func TestAccDataboxEdgeOrder_basic(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_databox_edge_order", "test") r := DataboxEdgeOrderResource{} + if features.FourPointOhBeta() { + t.Skipf("Skipping since `azurerm_databox_edge_order` is deprecated and will be removed in 4.0") + } + data.ResourceTest(t, r, []acceptance.TestStep{ { Config: r.basic(data), @@ -35,6 +40,10 @@ func TestAccDataboxEdgeOrder_requiresImport(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_databox_edge_order", "test") r := DataboxEdgeOrderResource{} + if features.FourPointOhBeta() { + t.Skipf("Skipping since `azurerm_databox_edge_order` is deprecated and will be removed in 4.0") + } + data.ResourceTest(t, r, []acceptance.TestStep{ { Config: r.basic(data), @@ -53,6 +62,10 @@ func TestAccDataboxEdgeOrder_complete(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_databox_edge_order", "test") r := DataboxEdgeOrderResource{} + if features.FourPointOhBeta() { + t.Skipf("Skipping since `azurerm_databox_edge_order` is deprecated and will be removed in 4.0") + } + data.ResourceTest(t, r, []acceptance.TestStep{ { Config: r.complete(data), diff --git a/internal/services/databoxedge/registration.go b/internal/services/databoxedge/registration.go index 94e2d3347510..51ddc4db4e85 100644 --- a/internal/services/databoxedge/registration.go +++ b/internal/services/databoxedge/registration.go @@ -1,6 +1,7 @@ package databoxedge import ( + "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) @@ -47,7 +48,10 @@ func (r Registration) SupportedDataSources() map[string]*pluginsdk.Resource { // SupportedResources returns the supported Resources supported by this Service func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { - return map[string]*pluginsdk.Resource{ - "azurerm_databox_edge_order": resourceOrder(), + if !features.FourPointOhBeta() { + return map[string]*pluginsdk.Resource{ + "azurerm_databox_edge_order": resourceOrder(), + } } + return map[string]*pluginsdk.Resource{} } diff --git a/website/docs/r/databox_edge_order.html.markdown b/website/docs/r/databox_edge_order.html.markdown index f7afc7a32ff4..c71592cf8b43 100644 --- a/website/docs/r/databox_edge_order.html.markdown +++ b/website/docs/r/databox_edge_order.html.markdown @@ -10,6 +10,8 @@ description: |- Manages a Databox Edge Order. +!> Creation of Databox Edge Order is not supported by the Azure API - as such the `azurerm_databox_edge_order` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. + ## Example Usage ```hcl