From 20b523889f94b1b58c4fde225e429d435091df63 Mon Sep 17 00:00:00 2001 From: hc-github-team-tf-azure <> Date: Tue, 4 Nov 2025 16:28:45 +0000 Subject: [PATCH] Updating based on 3aa9d2700 --- .../customoperation/model_connectioninfo.go | 2 +- .../model_mongodbconnectioninfo.go | 2 +- .../projectresource/model_connectioninfo.go | 2 +- .../model_mongodbconnectioninfo.go | 2 +- .../serviceresource/model_connectioninfo.go | 2 +- .../model_mongodbconnectioninfo.go | 2 +- .../taskresource/model_connectioninfo.go | 2 +- .../model_mongodbconnectioninfo.go | 2 +- .../mixedreality/2021-01-01/client.go | 46 --- .../mixedreality/2021-01-01/key/README.md | 94 ------ .../mixedreality/2021-01-01/key/client.go | 26 -- .../mixedreality/2021-01-01/key/constants.go | 18 -- .../key/id_remoterenderingaccount.go | 130 -------- .../key/id_remoterenderingaccount_test.go | 282 ------------------ .../key/id_spatialanchorsaccount.go | 130 -------- .../key/id_spatialanchorsaccount_test.go | 282 ------------------ .../method_remoterenderingaccountslistkeys.go | 54 ---- ...d_remoterenderingaccountsregeneratekeys.go | 58 ---- .../method_spatialanchorsaccountslistkeys.go | 54 ---- ...od_spatialanchorsaccountsregeneratekeys.go | 58 ---- .../key/model_accountkeyregeneraterequest.go | 8 - .../2021-01-01/key/model_accountkeys.go | 9 - .../mixedreality/2021-01-01/key/version.go | 10 - .../mixedreality/2021-01-01/proxy/README.md | 76 ----- .../mixedreality/2021-01-01/proxy/client.go | 26 -- .../2021-01-01/proxy/constants.go | 98 ------ .../2021-01-01/proxy/id_location.go | 121 -------- .../2021-01-01/proxy/id_location_test.go | 237 --------------- .../method_checknameavailabilitylocal.go | 58 ---- ...moterenderingaccountslistbysubscription.go | 106 ------- ...patialanchorsaccountslistbysubscription.go | 106 ------- .../model_checknameavailabilityrequest.go | 9 - .../model_checknameavailabilityresponse.go | 10 - .../model_mixedrealityaccountproperties.go | 10 - .../proxy/model_remoterenderingaccount.go | 23 -- .../2021-01-01/proxy/model_sku.go | 12 - .../proxy/model_spatialanchorsaccount.go | 23 -- .../2021-01-01/proxy/predicates.go | 60 ---- .../mixedreality/2021-01-01/proxy/version.go | 10 - .../2021-01-01/resource/README.md | 237 --------------- .../2021-01-01/resource/client.go | 26 -- .../2021-01-01/resource/constants.go | 57 ---- .../resource/id_remoterenderingaccount.go | 130 -------- .../id_remoterenderingaccount_test.go | 282 ------------------ .../resource/id_spatialanchorsaccount.go | 130 -------- .../resource/id_spatialanchorsaccount_test.go | 282 ------------------ .../method_remoterenderingaccountscreate.go | 58 ---- .../method_remoterenderingaccountsdelete.go | 47 --- .../method_remoterenderingaccountsget.go | 53 ---- ...oterenderingaccountslistbyresourcegroup.go | 106 ------- ...moterenderingaccountslistbysubscription.go | 106 ------- .../method_remoterenderingaccountsupdate.go | 57 ---- .../method_spatialanchorsaccountscreate.go | 58 ---- .../method_spatialanchorsaccountsdelete.go | 47 --- .../method_spatialanchorsaccountsget.go | 53 ---- ...atialanchorsaccountslistbyresourcegroup.go | 106 ------- ...patialanchorsaccountslistbysubscription.go | 106 ------- .../method_spatialanchorsaccountsupdate.go | 57 ---- .../model_mixedrealityaccountproperties.go | 10 - .../resource/model_remoterenderingaccount.go | 23 -- .../2021-01-01/resource/model_sku.go | 12 - .../resource/model_spatialanchorsaccount.go | 23 -- .../2021-01-01/resource/predicates.go | 60 ---- .../2021-01-01/resource/version.go | 10 - .../mixedreality/2025-01-01/client.go | 46 --- .../mixedreality/2025-01-01/key/README.md | 57 ---- .../mixedreality/2025-01-01/key/client.go | 26 -- .../mixedreality/2025-01-01/key/constants.go | 18 -- .../key/id_remoterenderingaccount.go | 130 -------- .../key/id_remoterenderingaccount_test.go | 282 ------------------ .../method_remoterenderingaccountslistkeys.go | 54 ---- ...d_remoterenderingaccountsregeneratekeys.go | 58 ---- .../key/model_accountkeyregeneraterequest.go | 8 - .../2025-01-01/key/model_accountkeys.go | 9 - .../mixedreality/2025-01-01/key/version.go | 10 - .../mixedreality/2025-01-01/proxy/README.md | 59 ---- .../mixedreality/2025-01-01/proxy/client.go | 26 -- .../2025-01-01/proxy/constants.go | 98 ------ .../2025-01-01/proxy/id_location.go | 121 -------- .../2025-01-01/proxy/id_location_test.go | 237 --------------- .../method_checknameavailabilitylocal.go | 58 ---- ...moterenderingaccountslistbysubscription.go | 106 ------- .../model_checknameavailabilityrequest.go | 9 - .../model_checknameavailabilityresponse.go | 10 - .../model_mixedrealityaccountproperties.go | 10 - .../proxy/model_remoterenderingaccount.go | 23 -- .../2025-01-01/proxy/model_sku.go | 12 - .../2025-01-01/proxy/predicates.go | 32 -- .../mixedreality/2025-01-01/proxy/version.go | 10 - .../2025-01-01/resource/README.md | 129 -------- .../2025-01-01/resource/client.go | 26 -- .../2025-01-01/resource/constants.go | 57 ---- .../resource/id_remoterenderingaccount.go | 130 -------- .../id_remoterenderingaccount_test.go | 282 ------------------ .../method_remoterenderingaccountscreate.go | 58 ---- .../method_remoterenderingaccountsdelete.go | 47 --- .../method_remoterenderingaccountsget.go | 53 ---- ...oterenderingaccountslistbyresourcegroup.go | 106 ------- ...moterenderingaccountslistbysubscription.go | 106 ------- .../method_remoterenderingaccountsupdate.go | 57 ---- .../model_mixedrealityaccountproperties.go | 10 - .../resource/model_remoterenderingaccount.go | 23 -- .../2025-01-01/resource/model_sku.go | 12 - .../2025-01-01/resource/predicates.go | 32 -- .../2025-01-01/resource/version.go | 10 - .../constants.go | 6 - .../constants.go | 6 - .../constants.go | 6 - .../constants.go | 6 - .../constants.go | 6 + .../constants.go | 6 + .../constants.go | 6 + .../constants.go | 6 + .../constants.go | 6 - .../constants.go | 6 - .../model_erroradditionalinfo.go | 9 - .../protecteditems/model_errordetail.go | 8 +- .../model_erroradditionalinfo.go | 9 - .../protectioncontainers/model_errordetail.go | 8 +- .../model_erroradditionalinfo.go | 9 - .../model_errordetail.go | 8 +- .../operation/model_erroradditionalinfo.go | 9 - .../2025-08-01/operation/model_errordetail.go | 8 +- .../model_erroradditionalinfo.go | 9 - .../protecteditems/model_errordetail.go | 8 +- 125 files changed, 47 insertions(+), 7141 deletions(-) delete mode 100644 resource-manager/mixedreality/2021-01-01/client.go delete mode 100644 resource-manager/mixedreality/2021-01-01/key/README.md delete mode 100644 resource-manager/mixedreality/2021-01-01/key/client.go delete mode 100644 resource-manager/mixedreality/2021-01-01/key/constants.go delete mode 100644 resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount.go delete mode 100644 resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount_test.go delete mode 100644 resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount.go delete mode 100644 resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount_test.go delete mode 100644 resource-manager/mixedreality/2021-01-01/key/method_remoterenderingaccountslistkeys.go delete mode 100644 resource-manager/mixedreality/2021-01-01/key/method_remoterenderingaccountsregeneratekeys.go delete mode 100644 resource-manager/mixedreality/2021-01-01/key/method_spatialanchorsaccountslistkeys.go delete mode 100644 resource-manager/mixedreality/2021-01-01/key/method_spatialanchorsaccountsregeneratekeys.go delete mode 100644 resource-manager/mixedreality/2021-01-01/key/model_accountkeyregeneraterequest.go delete mode 100644 resource-manager/mixedreality/2021-01-01/key/model_accountkeys.go delete mode 100644 resource-manager/mixedreality/2021-01-01/key/version.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/README.md delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/client.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/constants.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/id_location.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/id_location_test.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/method_checknameavailabilitylocal.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/method_remoterenderingaccountslistbysubscription.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/method_spatialanchorsaccountslistbysubscription.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/model_checknameavailabilityrequest.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/model_checknameavailabilityresponse.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/model_mixedrealityaccountproperties.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/model_remoterenderingaccount.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/model_sku.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/model_spatialanchorsaccount.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/predicates.go delete mode 100644 resource-manager/mixedreality/2021-01-01/proxy/version.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/README.md delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/client.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/constants.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount_test.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount_test.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountscreate.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountsdelete.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountsget.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountslistbyresourcegroup.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountslistbysubscription.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountsupdate.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountscreate.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountsdelete.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountsget.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountslistbyresourcegroup.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountslistbysubscription.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountsupdate.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/model_mixedrealityaccountproperties.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/model_remoterenderingaccount.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/model_sku.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/model_spatialanchorsaccount.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/predicates.go delete mode 100644 resource-manager/mixedreality/2021-01-01/resource/version.go delete mode 100644 resource-manager/mixedreality/2025-01-01/client.go delete mode 100644 resource-manager/mixedreality/2025-01-01/key/README.md delete mode 100644 resource-manager/mixedreality/2025-01-01/key/client.go delete mode 100644 resource-manager/mixedreality/2025-01-01/key/constants.go delete mode 100644 resource-manager/mixedreality/2025-01-01/key/id_remoterenderingaccount.go delete mode 100644 resource-manager/mixedreality/2025-01-01/key/id_remoterenderingaccount_test.go delete mode 100644 resource-manager/mixedreality/2025-01-01/key/method_remoterenderingaccountslistkeys.go delete mode 100644 resource-manager/mixedreality/2025-01-01/key/method_remoterenderingaccountsregeneratekeys.go delete mode 100644 resource-manager/mixedreality/2025-01-01/key/model_accountkeyregeneraterequest.go delete mode 100644 resource-manager/mixedreality/2025-01-01/key/model_accountkeys.go delete mode 100644 resource-manager/mixedreality/2025-01-01/key/version.go delete mode 100644 resource-manager/mixedreality/2025-01-01/proxy/README.md delete mode 100644 resource-manager/mixedreality/2025-01-01/proxy/client.go delete mode 100644 resource-manager/mixedreality/2025-01-01/proxy/constants.go delete mode 100644 resource-manager/mixedreality/2025-01-01/proxy/id_location.go delete mode 100644 resource-manager/mixedreality/2025-01-01/proxy/id_location_test.go delete mode 100644 resource-manager/mixedreality/2025-01-01/proxy/method_checknameavailabilitylocal.go delete mode 100644 resource-manager/mixedreality/2025-01-01/proxy/method_remoterenderingaccountslistbysubscription.go delete mode 100644 resource-manager/mixedreality/2025-01-01/proxy/model_checknameavailabilityrequest.go delete mode 100644 resource-manager/mixedreality/2025-01-01/proxy/model_checknameavailabilityresponse.go delete mode 100644 resource-manager/mixedreality/2025-01-01/proxy/model_mixedrealityaccountproperties.go delete mode 100644 resource-manager/mixedreality/2025-01-01/proxy/model_remoterenderingaccount.go delete mode 100644 resource-manager/mixedreality/2025-01-01/proxy/model_sku.go delete mode 100644 resource-manager/mixedreality/2025-01-01/proxy/predicates.go delete mode 100644 resource-manager/mixedreality/2025-01-01/proxy/version.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/README.md delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/client.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/constants.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/id_remoterenderingaccount.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/id_remoterenderingaccount_test.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountscreate.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountsdelete.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountsget.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountslistbyresourcegroup.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountslistbysubscription.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountsupdate.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/model_mixedrealityaccountproperties.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/model_remoterenderingaccount.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/model_sku.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/predicates.go delete mode 100644 resource-manager/mixedreality/2025-01-01/resource/version.go delete mode 100644 resource-manager/recoveryservicesbackup/2025-02-01/protecteditems/model_erroradditionalinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2025-02-01/protectioncontainers/model_erroradditionalinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2025-02-01/softdeletedcontainers/model_erroradditionalinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2025-08-01/operation/model_erroradditionalinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2025-08-01/protecteditems/model_erroradditionalinfo.go diff --git a/resource-manager/datamigration/2025-06-30/customoperation/model_connectioninfo.go b/resource-manager/datamigration/2025-06-30/customoperation/model_connectioninfo.go index 1e62657e3a1..b900b18932b 100644 --- a/resource-manager/datamigration/2025-06-30/customoperation/model_connectioninfo.go +++ b/resource-manager/datamigration/2025-06-30/customoperation/model_connectioninfo.go @@ -63,7 +63,7 @@ func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) return out, nil } - if strings.EqualFold(value, "MongoDbConnectionInfo") { + if strings.EqualFold(value, "mongoDbConnectionInfo") { var out MongoDbConnectionInfo if err := json.Unmarshal(input, &out); err != nil { return nil, fmt.Errorf("unmarshaling into MongoDbConnectionInfo: %+v", err) diff --git a/resource-manager/datamigration/2025-06-30/customoperation/model_mongodbconnectioninfo.go b/resource-manager/datamigration/2025-06-30/customoperation/model_mongodbconnectioninfo.go index 06754bb9de4..6183bc078d8 100644 --- a/resource-manager/datamigration/2025-06-30/customoperation/model_mongodbconnectioninfo.go +++ b/resource-manager/datamigration/2025-06-30/customoperation/model_mongodbconnectioninfo.go @@ -53,7 +53,7 @@ func (s MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("unmarshaling MongoDbConnectionInfo: %+v", err) } - decoded["type"] = "MongoDbConnectionInfo" + decoded["type"] = "mongoDbConnectionInfo" encoded, err = json.Marshal(decoded) if err != nil { diff --git a/resource-manager/datamigration/2025-06-30/projectresource/model_connectioninfo.go b/resource-manager/datamigration/2025-06-30/projectresource/model_connectioninfo.go index 2c2c6b0788a..0465da61fa2 100644 --- a/resource-manager/datamigration/2025-06-30/projectresource/model_connectioninfo.go +++ b/resource-manager/datamigration/2025-06-30/projectresource/model_connectioninfo.go @@ -63,7 +63,7 @@ func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) return out, nil } - if strings.EqualFold(value, "MongoDbConnectionInfo") { + if strings.EqualFold(value, "mongoDbConnectionInfo") { var out MongoDbConnectionInfo if err := json.Unmarshal(input, &out); err != nil { return nil, fmt.Errorf("unmarshaling into MongoDbConnectionInfo: %+v", err) diff --git a/resource-manager/datamigration/2025-06-30/projectresource/model_mongodbconnectioninfo.go b/resource-manager/datamigration/2025-06-30/projectresource/model_mongodbconnectioninfo.go index 48be3eb1426..a3d142d43a1 100644 --- a/resource-manager/datamigration/2025-06-30/projectresource/model_mongodbconnectioninfo.go +++ b/resource-manager/datamigration/2025-06-30/projectresource/model_mongodbconnectioninfo.go @@ -53,7 +53,7 @@ func (s MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("unmarshaling MongoDbConnectionInfo: %+v", err) } - decoded["type"] = "MongoDbConnectionInfo" + decoded["type"] = "mongoDbConnectionInfo" encoded, err = json.Marshal(decoded) if err != nil { diff --git a/resource-manager/datamigration/2025-06-30/serviceresource/model_connectioninfo.go b/resource-manager/datamigration/2025-06-30/serviceresource/model_connectioninfo.go index 6e9f1a364e2..3047b7e0a50 100644 --- a/resource-manager/datamigration/2025-06-30/serviceresource/model_connectioninfo.go +++ b/resource-manager/datamigration/2025-06-30/serviceresource/model_connectioninfo.go @@ -63,7 +63,7 @@ func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) return out, nil } - if strings.EqualFold(value, "mongoDbConnectionInfo") { + if strings.EqualFold(value, "MongoDbConnectionInfo") { var out MongoDbConnectionInfo if err := json.Unmarshal(input, &out); err != nil { return nil, fmt.Errorf("unmarshaling into MongoDbConnectionInfo: %+v", err) diff --git a/resource-manager/datamigration/2025-06-30/serviceresource/model_mongodbconnectioninfo.go b/resource-manager/datamigration/2025-06-30/serviceresource/model_mongodbconnectioninfo.go index 767bc368136..3a521195e00 100644 --- a/resource-manager/datamigration/2025-06-30/serviceresource/model_mongodbconnectioninfo.go +++ b/resource-manager/datamigration/2025-06-30/serviceresource/model_mongodbconnectioninfo.go @@ -53,7 +53,7 @@ func (s MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("unmarshaling MongoDbConnectionInfo: %+v", err) } - decoded["type"] = "mongoDbConnectionInfo" + decoded["type"] = "MongoDbConnectionInfo" encoded, err = json.Marshal(decoded) if err != nil { diff --git a/resource-manager/datamigration/2025-06-30/taskresource/model_connectioninfo.go b/resource-manager/datamigration/2025-06-30/taskresource/model_connectioninfo.go index 41c28de5b58..75a9f172f04 100644 --- a/resource-manager/datamigration/2025-06-30/taskresource/model_connectioninfo.go +++ b/resource-manager/datamigration/2025-06-30/taskresource/model_connectioninfo.go @@ -63,7 +63,7 @@ func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) return out, nil } - if strings.EqualFold(value, "mongoDbConnectionInfo") { + if strings.EqualFold(value, "MongoDbConnectionInfo") { var out MongoDbConnectionInfo if err := json.Unmarshal(input, &out); err != nil { return nil, fmt.Errorf("unmarshaling into MongoDbConnectionInfo: %+v", err) diff --git a/resource-manager/datamigration/2025-06-30/taskresource/model_mongodbconnectioninfo.go b/resource-manager/datamigration/2025-06-30/taskresource/model_mongodbconnectioninfo.go index c54f00935ed..7fcca941b2c 100644 --- a/resource-manager/datamigration/2025-06-30/taskresource/model_mongodbconnectioninfo.go +++ b/resource-manager/datamigration/2025-06-30/taskresource/model_mongodbconnectioninfo.go @@ -53,7 +53,7 @@ func (s MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("unmarshaling MongoDbConnectionInfo: %+v", err) } - decoded["type"] = "mongoDbConnectionInfo" + decoded["type"] = "MongoDbConnectionInfo" encoded, err = json.Marshal(decoded) if err != nil { diff --git a/resource-manager/mixedreality/2021-01-01/client.go b/resource-manager/mixedreality/2021-01-01/client.go deleted file mode 100644 index 048a11e4d6b..00000000000 --- a/resource-manager/mixedreality/2021-01-01/client.go +++ /dev/null @@ -1,46 +0,0 @@ -package v2021_01_01 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2021-01-01/key" - "github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2021-01-01/proxy" - "github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2021-01-01/resource" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - Key *key.KeyClient - Proxy *proxy.ProxyClient - Resource *resource.ResourceClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - keyClient, err := key.NewKeyClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Key client: %+v", err) - } - configureFunc(keyClient.Client) - - proxyClient, err := proxy.NewProxyClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Proxy client: %+v", err) - } - configureFunc(proxyClient.Client) - - resourceClient, err := resource.NewResourceClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Resource client: %+v", err) - } - configureFunc(resourceClient.Client) - - return &Client{ - Key: keyClient, - Proxy: proxyClient, - Resource: resourceClient, - }, nil -} diff --git a/resource-manager/mixedreality/2021-01-01/key/README.md b/resource-manager/mixedreality/2021-01-01/key/README.md deleted file mode 100644 index cf3e957aa75..00000000000 --- a/resource-manager/mixedreality/2021-01-01/key/README.md +++ /dev/null @@ -1,94 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2021-01-01/key` Documentation - -The `key` SDK allows for interaction with Azure Resource Manager `mixedreality` (API Version `2021-01-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/mixedreality/2021-01-01/key" -``` - - -### Client Initialization - -```go -client := key.NewKeyClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `KeyClient.RemoteRenderingAccountsListKeys` - -```go -ctx := context.TODO() -id := key.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - -read, err := client.RemoteRenderingAccountsListKeys(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `KeyClient.RemoteRenderingAccountsRegenerateKeys` - -```go -ctx := context.TODO() -id := key.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - -payload := key.AccountKeyRegenerateRequest{ - // ... -} - - -read, err := client.RemoteRenderingAccountsRegenerateKeys(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `KeyClient.SpatialAnchorsAccountsListKeys` - -```go -ctx := context.TODO() -id := key.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") - -read, err := client.SpatialAnchorsAccountsListKeys(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `KeyClient.SpatialAnchorsAccountsRegenerateKeys` - -```go -ctx := context.TODO() -id := key.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") - -payload := key.AccountKeyRegenerateRequest{ - // ... -} - - -read, err := client.SpatialAnchorsAccountsRegenerateKeys(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/resource-manager/mixedreality/2021-01-01/key/client.go b/resource-manager/mixedreality/2021-01-01/key/client.go deleted file mode 100644 index 3c29cfe2291..00000000000 --- a/resource-manager/mixedreality/2021-01-01/key/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package key - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KeyClient struct { - Client *resourcemanager.Client -} - -func NewKeyClientWithBaseURI(sdkApi sdkEnv.Api) (*KeyClient, error) { - client, err := resourcemanager.NewClient(sdkApi, "key", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating KeyClient: %+v", err) - } - - return &KeyClient{ - Client: client, - }, nil -} diff --git a/resource-manager/mixedreality/2021-01-01/key/constants.go b/resource-manager/mixedreality/2021-01-01/key/constants.go deleted file mode 100644 index 4dc132d61a1..00000000000 --- a/resource-manager/mixedreality/2021-01-01/key/constants.go +++ /dev/null @@ -1,18 +0,0 @@ -package key - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Serial int64 - -const ( - SerialPrimary Serial = 1 - SerialSecondary Serial = 2 -) - -func PossibleValuesForSerial() []int64 { - return []int64{ - int64(SerialPrimary), - int64(SerialSecondary), - } -} diff --git a/resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount.go b/resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount.go deleted file mode 100644 index e9f8cd8d3d7..00000000000 --- a/resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount.go +++ /dev/null @@ -1,130 +0,0 @@ -package key - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&RemoteRenderingAccountId{}) -} - -var _ resourceids.ResourceId = &RemoteRenderingAccountId{} - -// RemoteRenderingAccountId is a struct representing the Resource ID for a Remote Rendering Account -type RemoteRenderingAccountId struct { - SubscriptionId string - ResourceGroupName string - RemoteRenderingAccountName string -} - -// NewRemoteRenderingAccountID returns a new RemoteRenderingAccountId struct -func NewRemoteRenderingAccountID(subscriptionId string, resourceGroupName string, remoteRenderingAccountName string) RemoteRenderingAccountId { - return RemoteRenderingAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RemoteRenderingAccountName: remoteRenderingAccountName, - } -} - -// ParseRemoteRenderingAccountID parses 'input' into a RemoteRenderingAccountId -func ParseRemoteRenderingAccountID(input string) (*RemoteRenderingAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(&RemoteRenderingAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RemoteRenderingAccountId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRemoteRenderingAccountIDInsensitively parses 'input' case-insensitively into a RemoteRenderingAccountId -// note: this method should only be used for API response data and not user input -func ParseRemoteRenderingAccountIDInsensitively(input string) (*RemoteRenderingAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(&RemoteRenderingAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RemoteRenderingAccountId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RemoteRenderingAccountId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RemoteRenderingAccountName, ok = input.Parsed["remoteRenderingAccountName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "remoteRenderingAccountName", input) - } - - return nil -} - -// ValidateRemoteRenderingAccountID checks that 'input' can be parsed as a Remote Rendering Account ID -func ValidateRemoteRenderingAccountID(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 := ParseRemoteRenderingAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Remote Rendering Account ID -func (id RemoteRenderingAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.MixedReality/remoteRenderingAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RemoteRenderingAccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Remote Rendering Account ID -func (id RemoteRenderingAccountId) 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("staticMicrosoftMixedReality", "Microsoft.MixedReality", "Microsoft.MixedReality"), - resourceids.StaticSegment("staticRemoteRenderingAccounts", "remoteRenderingAccounts", "remoteRenderingAccounts"), - resourceids.UserSpecifiedSegment("remoteRenderingAccountName", "remoteRenderingAccountName"), - } -} - -// String returns a human-readable description of this Remote Rendering Account ID -func (id RemoteRenderingAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Remote Rendering Account Name: %q", id.RemoteRenderingAccountName), - } - return fmt.Sprintf("Remote Rendering Account (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount_test.go b/resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount_test.go deleted file mode 100644 index 8a5b61d9e4c..00000000000 --- a/resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package key - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ resourceids.ResourceId = &RemoteRenderingAccountId{} - -func TestNewRemoteRenderingAccountID(t *testing.T) { - id := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - - if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") - } - - if id.ResourceGroupName != "example-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") - } - - if id.RemoteRenderingAccountName != "remoteRenderingAccountName" { - t.Fatalf("Expected %q but got %q for Segment 'RemoteRenderingAccountName'", id.RemoteRenderingAccountName, "remoteRenderingAccountName") - } -} - -func TestFormatRemoteRenderingAccountID(t *testing.T) { - actual := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRemoteRenderingAccountID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RemoteRenderingAccountId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName", - Expected: &RemoteRenderingAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RemoteRenderingAccountName: "remoteRenderingAccountName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRemoteRenderingAccountID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.ResourceGroupName != v.Expected.ResourceGroupName { - t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) - } - - if actual.RemoteRenderingAccountName != v.Expected.RemoteRenderingAccountName { - t.Fatalf("Expected %q but got %q for RemoteRenderingAccountName", v.Expected.RemoteRenderingAccountName, actual.RemoteRenderingAccountName) - } - - } -} - -func TestParseRemoteRenderingAccountIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RemoteRenderingAccountId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName", - Expected: &RemoteRenderingAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RemoteRenderingAccountName: "remoteRenderingAccountName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/rEmOtErEnDeRiNgAcCoUnTnAmE", - Expected: &RemoteRenderingAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RemoteRenderingAccountName: "rEmOtErEnDeRiNgAcCoUnTnAmE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/rEmOtErEnDeRiNgAcCoUnTnAmE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRemoteRenderingAccountIDInsensitively(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.ResourceGroupName != v.Expected.ResourceGroupName { - t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) - } - - if actual.RemoteRenderingAccountName != v.Expected.RemoteRenderingAccountName { - t.Fatalf("Expected %q but got %q for RemoteRenderingAccountName", v.Expected.RemoteRenderingAccountName, actual.RemoteRenderingAccountName) - } - - } -} - -func TestSegmentsForRemoteRenderingAccountId(t *testing.T) { - segments := RemoteRenderingAccountId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RemoteRenderingAccountId has no segments") - } - - uniqueNames := make(map[string]struct{}, 0) - for _, segment := range segments { - uniqueNames[segment.Name] = struct{}{} - } - if len(uniqueNames) != len(segments) { - t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) - } -} diff --git a/resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount.go b/resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount.go deleted file mode 100644 index 85075afc865..00000000000 --- a/resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount.go +++ /dev/null @@ -1,130 +0,0 @@ -package key - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&SpatialAnchorsAccountId{}) -} - -var _ resourceids.ResourceId = &SpatialAnchorsAccountId{} - -// SpatialAnchorsAccountId is a struct representing the Resource ID for a Spatial Anchors Account -type SpatialAnchorsAccountId struct { - SubscriptionId string - ResourceGroupName string - SpatialAnchorsAccountName string -} - -// NewSpatialAnchorsAccountID returns a new SpatialAnchorsAccountId struct -func NewSpatialAnchorsAccountID(subscriptionId string, resourceGroupName string, spatialAnchorsAccountName string) SpatialAnchorsAccountId { - return SpatialAnchorsAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - SpatialAnchorsAccountName: spatialAnchorsAccountName, - } -} - -// ParseSpatialAnchorsAccountID parses 'input' into a SpatialAnchorsAccountId -func ParseSpatialAnchorsAccountID(input string) (*SpatialAnchorsAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(&SpatialAnchorsAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SpatialAnchorsAccountId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSpatialAnchorsAccountIDInsensitively parses 'input' case-insensitively into a SpatialAnchorsAccountId -// note: this method should only be used for API response data and not user input -func ParseSpatialAnchorsAccountIDInsensitively(input string) (*SpatialAnchorsAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(&SpatialAnchorsAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SpatialAnchorsAccountId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SpatialAnchorsAccountId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.SpatialAnchorsAccountName, ok = input.Parsed["spatialAnchorsAccountName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "spatialAnchorsAccountName", input) - } - - return nil -} - -// ValidateSpatialAnchorsAccountID checks that 'input' can be parsed as a Spatial Anchors Account ID -func ValidateSpatialAnchorsAccountID(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 := ParseSpatialAnchorsAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Spatial Anchors Account ID -func (id SpatialAnchorsAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.MixedReality/spatialAnchorsAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.SpatialAnchorsAccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Spatial Anchors Account ID -func (id SpatialAnchorsAccountId) 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("staticMicrosoftMixedReality", "Microsoft.MixedReality", "Microsoft.MixedReality"), - resourceids.StaticSegment("staticSpatialAnchorsAccounts", "spatialAnchorsAccounts", "spatialAnchorsAccounts"), - resourceids.UserSpecifiedSegment("spatialAnchorsAccountName", "spatialAnchorsAccountName"), - } -} - -// String returns a human-readable description of this Spatial Anchors Account ID -func (id SpatialAnchorsAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Spatial Anchors Account Name: %q", id.SpatialAnchorsAccountName), - } - return fmt.Sprintf("Spatial Anchors Account (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount_test.go b/resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount_test.go deleted file mode 100644 index b0f9c8131c7..00000000000 --- a/resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package key - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ resourceids.ResourceId = &SpatialAnchorsAccountId{} - -func TestNewSpatialAnchorsAccountID(t *testing.T) { - id := NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") - - if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") - } - - if id.ResourceGroupName != "example-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") - } - - if id.SpatialAnchorsAccountName != "spatialAnchorsAccountName" { - t.Fatalf("Expected %q but got %q for Segment 'SpatialAnchorsAccountName'", id.SpatialAnchorsAccountName, "spatialAnchorsAccountName") - } -} - -func TestFormatSpatialAnchorsAccountID(t *testing.T) { - actual := NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSpatialAnchorsAccountID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SpatialAnchorsAccountId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName", - Expected: &SpatialAnchorsAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - SpatialAnchorsAccountName: "spatialAnchorsAccountName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSpatialAnchorsAccountID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.ResourceGroupName != v.Expected.ResourceGroupName { - t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) - } - - if actual.SpatialAnchorsAccountName != v.Expected.SpatialAnchorsAccountName { - t.Fatalf("Expected %q but got %q for SpatialAnchorsAccountName", v.Expected.SpatialAnchorsAccountName, actual.SpatialAnchorsAccountName) - } - - } -} - -func TestParseSpatialAnchorsAccountIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SpatialAnchorsAccountId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/sPaTiAlAnChOrSaCcOuNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName", - Expected: &SpatialAnchorsAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - SpatialAnchorsAccountName: "spatialAnchorsAccountName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/sPaTiAlAnChOrSaCcOuNtS/sPaTiAlAnChOrSaCcOuNtNaMe", - Expected: &SpatialAnchorsAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpatialAnchorsAccountName: "sPaTiAlAnChOrSaCcOuNtNaMe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/sPaTiAlAnChOrSaCcOuNtS/sPaTiAlAnChOrSaCcOuNtNaMe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSpatialAnchorsAccountIDInsensitively(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.ResourceGroupName != v.Expected.ResourceGroupName { - t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) - } - - if actual.SpatialAnchorsAccountName != v.Expected.SpatialAnchorsAccountName { - t.Fatalf("Expected %q but got %q for SpatialAnchorsAccountName", v.Expected.SpatialAnchorsAccountName, actual.SpatialAnchorsAccountName) - } - - } -} - -func TestSegmentsForSpatialAnchorsAccountId(t *testing.T) { - segments := SpatialAnchorsAccountId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SpatialAnchorsAccountId has no segments") - } - - uniqueNames := make(map[string]struct{}, 0) - for _, segment := range segments { - uniqueNames[segment.Name] = struct{}{} - } - if len(uniqueNames) != len(segments) { - t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) - } -} diff --git a/resource-manager/mixedreality/2021-01-01/key/method_remoterenderingaccountslistkeys.go b/resource-manager/mixedreality/2021-01-01/key/method_remoterenderingaccountslistkeys.go deleted file mode 100644 index 6fc308963e4..00000000000 --- a/resource-manager/mixedreality/2021-01-01/key/method_remoterenderingaccountslistkeys.go +++ /dev/null @@ -1,54 +0,0 @@ -package key - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsListKeysOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AccountKeys -} - -// RemoteRenderingAccountsListKeys ... -func (c KeyClient) RemoteRenderingAccountsListKeys(ctx context.Context, id RemoteRenderingAccountId) (result RemoteRenderingAccountsListKeysOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listKeys", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model AccountKeys - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2021-01-01/key/method_remoterenderingaccountsregeneratekeys.go b/resource-manager/mixedreality/2021-01-01/key/method_remoterenderingaccountsregeneratekeys.go deleted file mode 100644 index f8d284d7099..00000000000 --- a/resource-manager/mixedreality/2021-01-01/key/method_remoterenderingaccountsregeneratekeys.go +++ /dev/null @@ -1,58 +0,0 @@ -package key - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsRegenerateKeysOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AccountKeys -} - -// RemoteRenderingAccountsRegenerateKeys ... -func (c KeyClient) RemoteRenderingAccountsRegenerateKeys(ctx context.Context, id RemoteRenderingAccountId, input AccountKeyRegenerateRequest) (result RemoteRenderingAccountsRegenerateKeysOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/regenerateKeys", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model AccountKeys - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2021-01-01/key/method_spatialanchorsaccountslistkeys.go b/resource-manager/mixedreality/2021-01-01/key/method_spatialanchorsaccountslistkeys.go deleted file mode 100644 index d2b8f314e86..00000000000 --- a/resource-manager/mixedreality/2021-01-01/key/method_spatialanchorsaccountslistkeys.go +++ /dev/null @@ -1,54 +0,0 @@ -package key - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SpatialAnchorsAccountsListKeysOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AccountKeys -} - -// SpatialAnchorsAccountsListKeys ... -func (c KeyClient) SpatialAnchorsAccountsListKeys(ctx context.Context, id SpatialAnchorsAccountId) (result SpatialAnchorsAccountsListKeysOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listKeys", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model AccountKeys - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2021-01-01/key/method_spatialanchorsaccountsregeneratekeys.go b/resource-manager/mixedreality/2021-01-01/key/method_spatialanchorsaccountsregeneratekeys.go deleted file mode 100644 index 31c50d6bc6d..00000000000 --- a/resource-manager/mixedreality/2021-01-01/key/method_spatialanchorsaccountsregeneratekeys.go +++ /dev/null @@ -1,58 +0,0 @@ -package key - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SpatialAnchorsAccountsRegenerateKeysOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AccountKeys -} - -// SpatialAnchorsAccountsRegenerateKeys ... -func (c KeyClient) SpatialAnchorsAccountsRegenerateKeys(ctx context.Context, id SpatialAnchorsAccountId, input AccountKeyRegenerateRequest) (result SpatialAnchorsAccountsRegenerateKeysOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/regenerateKeys", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model AccountKeys - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2021-01-01/key/model_accountkeyregeneraterequest.go b/resource-manager/mixedreality/2021-01-01/key/model_accountkeyregeneraterequest.go deleted file mode 100644 index a16d03f1419..00000000000 --- a/resource-manager/mixedreality/2021-01-01/key/model_accountkeyregeneraterequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package key - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountKeyRegenerateRequest struct { - Serial *Serial `json:"serial,omitempty"` -} diff --git a/resource-manager/mixedreality/2021-01-01/key/model_accountkeys.go b/resource-manager/mixedreality/2021-01-01/key/model_accountkeys.go deleted file mode 100644 index 30dec438536..00000000000 --- a/resource-manager/mixedreality/2021-01-01/key/model_accountkeys.go +++ /dev/null @@ -1,9 +0,0 @@ -package key - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountKeys struct { - PrimaryKey *string `json:"primaryKey,omitempty"` - SecondaryKey *string `json:"secondaryKey,omitempty"` -} diff --git a/resource-manager/mixedreality/2021-01-01/key/version.go b/resource-manager/mixedreality/2021-01-01/key/version.go deleted file mode 100644 index 438e389451b..00000000000 --- a/resource-manager/mixedreality/2021-01-01/key/version.go +++ /dev/null @@ -1,10 +0,0 @@ -package key - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-01-01" - -func userAgent() string { - return "hashicorp/go-azure-sdk/key/2021-01-01" -} diff --git a/resource-manager/mixedreality/2021-01-01/proxy/README.md b/resource-manager/mixedreality/2021-01-01/proxy/README.md deleted file mode 100644 index e0784366281..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/README.md +++ /dev/null @@ -1,76 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2021-01-01/proxy` Documentation - -The `proxy` SDK allows for interaction with Azure Resource Manager `mixedreality` (API Version `2021-01-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2021-01-01/proxy" -``` - - -### Client Initialization - -```go -client := proxy.NewProxyClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ProxyClient.CheckNameAvailabilityLocal` - -```go -ctx := context.TODO() -id := proxy.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") - -payload := proxy.CheckNameAvailabilityRequest{ - // ... -} - - -read, err := client.CheckNameAvailabilityLocal(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ProxyClient.RemoteRenderingAccountsListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.RemoteRenderingAccountsListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.RemoteRenderingAccountsListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ProxyClient.SpatialAnchorsAccountsListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.SpatialAnchorsAccountsListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.SpatialAnchorsAccountsListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/mixedreality/2021-01-01/proxy/client.go b/resource-manager/mixedreality/2021-01-01/proxy/client.go deleted file mode 100644 index daaef6e0be4..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package proxy - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ProxyClient struct { - Client *resourcemanager.Client -} - -func NewProxyClientWithBaseURI(sdkApi sdkEnv.Api) (*ProxyClient, error) { - client, err := resourcemanager.NewClient(sdkApi, "proxy", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ProxyClient: %+v", err) - } - - return &ProxyClient{ - Client: client, - }, nil -} diff --git a/resource-manager/mixedreality/2021-01-01/proxy/constants.go b/resource-manager/mixedreality/2021-01-01/proxy/constants.go deleted file mode 100644 index 99e9fd6d941..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/constants.go +++ /dev/null @@ -1,98 +0,0 @@ -package proxy - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NameUnavailableReason string - -const ( - NameUnavailableReasonAlreadyExists NameUnavailableReason = "AlreadyExists" - NameUnavailableReasonInvalid NameUnavailableReason = "Invalid" -) - -func PossibleValuesForNameUnavailableReason() []string { - return []string{ - string(NameUnavailableReasonAlreadyExists), - string(NameUnavailableReasonInvalid), - } -} - -func (s *NameUnavailableReason) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNameUnavailableReason(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNameUnavailableReason(input string) (*NameUnavailableReason, error) { - vals := map[string]NameUnavailableReason{ - "alreadyexists": NameUnavailableReasonAlreadyExists, - "invalid": NameUnavailableReasonInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NameUnavailableReason(input) - return &out, nil -} - -type SkuTier string - -const ( - SkuTierBasic SkuTier = "Basic" - SkuTierFree SkuTier = "Free" - SkuTierPremium SkuTier = "Premium" - SkuTierStandard SkuTier = "Standard" -) - -func PossibleValuesForSkuTier() []string { - return []string{ - string(SkuTierBasic), - string(SkuTierFree), - string(SkuTierPremium), - string(SkuTierStandard), - } -} - -func (s *SkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSkuTier(input string) (*SkuTier, error) { - vals := map[string]SkuTier{ - "basic": SkuTierBasic, - "free": SkuTierFree, - "premium": SkuTierPremium, - "standard": SkuTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SkuTier(input) - return &out, nil -} diff --git a/resource-manager/mixedreality/2021-01-01/proxy/id_location.go b/resource-manager/mixedreality/2021-01-01/proxy/id_location.go deleted file mode 100644 index 66ee4faa862..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package proxy - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&LocationId{}) -} - -var _ resourceids.ResourceId = &LocationId{} - -// LocationId is a struct representing the Resource ID for a Location -type LocationId struct { - SubscriptionId string - LocationName string -} - -// NewLocationID returns a new LocationId struct -func NewLocationID(subscriptionId string, locationName string) LocationId { - return LocationId{ - SubscriptionId: subscriptionId, - LocationName: locationName, - } -} - -// ParseLocationID parses 'input' into a LocationId -func ParseLocationID(input string) (*LocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&LocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LocationId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId -// note: this method should only be used for API response data and not user input -func ParseLocationIDInsensitively(input string) (*LocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&LocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LocationId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LocationId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateLocationID checks that 'input' can be parsed as a Location ID -func ValidateLocationID(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 := ParseLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Location ID -func (id LocationId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.MixedReality/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Location ID -func (id LocationId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftMixedReality", "Microsoft.MixedReality", "Microsoft.MixedReality"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationName"), - } -} - -// String returns a human-readable description of this Location ID -func (id LocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/mixedreality/2021-01-01/proxy/id_location_test.go b/resource-manager/mixedreality/2021-01-01/proxy/id_location_test.go deleted file mode 100644 index b8f94aa21f4..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package proxy - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ resourceids.ResourceId = &LocationId{} - -func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") - - if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") - } - - if id.LocationName != "locationName" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LocationId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLocationID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LocationId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/lOcAtIoNs/lOcAtIoNnAmE", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNnAmE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/lOcAtIoNs/lOcAtIoNnAmE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLocationIDInsensitively(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForLocationId(t *testing.T) { - segments := LocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LocationId has no segments") - } - - uniqueNames := make(map[string]struct{}, 0) - for _, segment := range segments { - uniqueNames[segment.Name] = struct{}{} - } - if len(uniqueNames) != len(segments) { - t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) - } -} diff --git a/resource-manager/mixedreality/2021-01-01/proxy/method_checknameavailabilitylocal.go b/resource-manager/mixedreality/2021-01-01/proxy/method_checknameavailabilitylocal.go deleted file mode 100644 index 6b96e01a34e..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/method_checknameavailabilitylocal.go +++ /dev/null @@ -1,58 +0,0 @@ -package proxy - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckNameAvailabilityLocalOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CheckNameAvailabilityResponse -} - -// CheckNameAvailabilityLocal ... -func (c ProxyClient) CheckNameAvailabilityLocal(ctx context.Context, id LocationId, input CheckNameAvailabilityRequest) (result CheckNameAvailabilityLocalOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/checkNameAvailability", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model CheckNameAvailabilityResponse - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2021-01-01/proxy/method_remoterenderingaccountslistbysubscription.go b/resource-manager/mixedreality/2021-01-01/proxy/method_remoterenderingaccountslistbysubscription.go deleted file mode 100644 index ced116976a6..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/method_remoterenderingaccountslistbysubscription.go +++ /dev/null @@ -1,106 +0,0 @@ -package proxy - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RemoteRenderingAccount -} - -type RemoteRenderingAccountsListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []RemoteRenderingAccount -} - -type RemoteRenderingAccountsListBySubscriptionCustomPager struct { - NextLink *odata.Link `json:"nextLink"` -} - -func (p *RemoteRenderingAccountsListBySubscriptionCustomPager) NextPageLink() *odata.Link { - defer func() { - p.NextLink = nil - }() - - return p.NextLink -} - -// RemoteRenderingAccountsListBySubscription ... -func (c ProxyClient) RemoteRenderingAccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result RemoteRenderingAccountsListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Pager: &RemoteRenderingAccountsListBySubscriptionCustomPager{}, - Path: fmt.Sprintf("%s/providers/Microsoft.MixedReality/remoteRenderingAccounts", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]RemoteRenderingAccount `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// RemoteRenderingAccountsListBySubscriptionComplete retrieves all the results into a single object -func (c ProxyClient) RemoteRenderingAccountsListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (RemoteRenderingAccountsListBySubscriptionCompleteResult, error) { - return c.RemoteRenderingAccountsListBySubscriptionCompleteMatchingPredicate(ctx, id, RemoteRenderingAccountOperationPredicate{}) -} - -// RemoteRenderingAccountsListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ProxyClient) RemoteRenderingAccountsListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate RemoteRenderingAccountOperationPredicate) (result RemoteRenderingAccountsListBySubscriptionCompleteResult, err error) { - items := make([]RemoteRenderingAccount, 0) - - resp, err := c.RemoteRenderingAccountsListBySubscription(ctx, id) - if err != nil { - result.LatestHttpResponse = resp.HttpResponse - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = RemoteRenderingAccountsListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/mixedreality/2021-01-01/proxy/method_spatialanchorsaccountslistbysubscription.go b/resource-manager/mixedreality/2021-01-01/proxy/method_spatialanchorsaccountslistbysubscription.go deleted file mode 100644 index 6f37625b82b..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/method_spatialanchorsaccountslistbysubscription.go +++ /dev/null @@ -1,106 +0,0 @@ -package proxy - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SpatialAnchorsAccountsListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]SpatialAnchorsAccount -} - -type SpatialAnchorsAccountsListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []SpatialAnchorsAccount -} - -type SpatialAnchorsAccountsListBySubscriptionCustomPager struct { - NextLink *odata.Link `json:"nextLink"` -} - -func (p *SpatialAnchorsAccountsListBySubscriptionCustomPager) NextPageLink() *odata.Link { - defer func() { - p.NextLink = nil - }() - - return p.NextLink -} - -// SpatialAnchorsAccountsListBySubscription ... -func (c ProxyClient) SpatialAnchorsAccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result SpatialAnchorsAccountsListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Pager: &SpatialAnchorsAccountsListBySubscriptionCustomPager{}, - Path: fmt.Sprintf("%s/providers/Microsoft.MixedReality/spatialAnchorsAccounts", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]SpatialAnchorsAccount `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// SpatialAnchorsAccountsListBySubscriptionComplete retrieves all the results into a single object -func (c ProxyClient) SpatialAnchorsAccountsListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (SpatialAnchorsAccountsListBySubscriptionCompleteResult, error) { - return c.SpatialAnchorsAccountsListBySubscriptionCompleteMatchingPredicate(ctx, id, SpatialAnchorsAccountOperationPredicate{}) -} - -// SpatialAnchorsAccountsListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ProxyClient) SpatialAnchorsAccountsListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate SpatialAnchorsAccountOperationPredicate) (result SpatialAnchorsAccountsListBySubscriptionCompleteResult, err error) { - items := make([]SpatialAnchorsAccount, 0) - - resp, err := c.SpatialAnchorsAccountsListBySubscription(ctx, id) - if err != nil { - result.LatestHttpResponse = resp.HttpResponse - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = SpatialAnchorsAccountsListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/mixedreality/2021-01-01/proxy/model_checknameavailabilityrequest.go b/resource-manager/mixedreality/2021-01-01/proxy/model_checknameavailabilityrequest.go deleted file mode 100644 index b34ef86abe3..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/model_checknameavailabilityrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package proxy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckNameAvailabilityRequest struct { - Name string `json:"name"` - Type string `json:"type"` -} diff --git a/resource-manager/mixedreality/2021-01-01/proxy/model_checknameavailabilityresponse.go b/resource-manager/mixedreality/2021-01-01/proxy/model_checknameavailabilityresponse.go deleted file mode 100644 index 70286c7568c..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/model_checknameavailabilityresponse.go +++ /dev/null @@ -1,10 +0,0 @@ -package proxy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckNameAvailabilityResponse struct { - Message *string `json:"message,omitempty"` - NameAvailable bool `json:"nameAvailable"` - Reason *NameUnavailableReason `json:"reason,omitempty"` -} diff --git a/resource-manager/mixedreality/2021-01-01/proxy/model_mixedrealityaccountproperties.go b/resource-manager/mixedreality/2021-01-01/proxy/model_mixedrealityaccountproperties.go deleted file mode 100644 index cfd4f9c3667..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/model_mixedrealityaccountproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package proxy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MixedRealityAccountProperties struct { - AccountDomain *string `json:"accountDomain,omitempty"` - AccountId *string `json:"accountId,omitempty"` - StorageAccountName *string `json:"storageAccountName,omitempty"` -} diff --git a/resource-manager/mixedreality/2021-01-01/proxy/model_remoterenderingaccount.go b/resource-manager/mixedreality/2021-01-01/proxy/model_remoterenderingaccount.go deleted file mode 100644 index 69a58208232..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/model_remoterenderingaccount.go +++ /dev/null @@ -1,23 +0,0 @@ -package proxy - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccount struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemAssigned `json:"identity,omitempty"` - Kind *Sku `json:"kind,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Plan *identity.SystemAssigned `json:"plan,omitempty"` - Properties *MixedRealityAccountProperties `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/resource-manager/mixedreality/2021-01-01/proxy/model_sku.go b/resource-manager/mixedreality/2021-01-01/proxy/model_sku.go deleted file mode 100644 index 808f70e8e4f..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/model_sku.go +++ /dev/null @@ -1,12 +0,0 @@ -package proxy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Sku struct { - Capacity *int64 `json:"capacity,omitempty"` - Family *string `json:"family,omitempty"` - Name string `json:"name"` - Size *string `json:"size,omitempty"` - Tier *SkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/mixedreality/2021-01-01/proxy/model_spatialanchorsaccount.go b/resource-manager/mixedreality/2021-01-01/proxy/model_spatialanchorsaccount.go deleted file mode 100644 index 76317363555..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/model_spatialanchorsaccount.go +++ /dev/null @@ -1,23 +0,0 @@ -package proxy - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SpatialAnchorsAccount struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemAssigned `json:"identity,omitempty"` - Kind *Sku `json:"kind,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Plan *identity.SystemAssigned `json:"plan,omitempty"` - Properties *MixedRealityAccountProperties `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/resource-manager/mixedreality/2021-01-01/proxy/predicates.go b/resource-manager/mixedreality/2021-01-01/proxy/predicates.go deleted file mode 100644 index 193cef426ad..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/predicates.go +++ /dev/null @@ -1,60 +0,0 @@ -package proxy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p RemoteRenderingAccountOperationPredicate) Matches(input RemoteRenderingAccount) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} - -type SpatialAnchorsAccountOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p SpatialAnchorsAccountOperationPredicate) Matches(input SpatialAnchorsAccount) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/resource-manager/mixedreality/2021-01-01/proxy/version.go b/resource-manager/mixedreality/2021-01-01/proxy/version.go deleted file mode 100644 index 27eb969d9a3..00000000000 --- a/resource-manager/mixedreality/2021-01-01/proxy/version.go +++ /dev/null @@ -1,10 +0,0 @@ -package proxy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-01-01" - -func userAgent() string { - return "hashicorp/go-azure-sdk/proxy/2021-01-01" -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/README.md b/resource-manager/mixedreality/2021-01-01/resource/README.md deleted file mode 100644 index 90cf810cda9..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/README.md +++ /dev/null @@ -1,237 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2021-01-01/resource` Documentation - -The `resource` SDK allows for interaction with Azure Resource Manager `mixedreality` (API Version `2021-01-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2021-01-01/resource" -``` - - -### Client Initialization - -```go -client := resource.NewResourceClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ResourceClient.RemoteRenderingAccountsCreate` - -```go -ctx := context.TODO() -id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - -payload := resource.RemoteRenderingAccount{ - // ... -} - - -read, err := client.RemoteRenderingAccountsCreate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ResourceClient.RemoteRenderingAccountsDelete` - -```go -ctx := context.TODO() -id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - -read, err := client.RemoteRenderingAccountsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ResourceClient.RemoteRenderingAccountsGet` - -```go -ctx := context.TODO() -id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - -read, err := client.RemoteRenderingAccountsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ResourceClient.RemoteRenderingAccountsListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.RemoteRenderingAccountsListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.RemoteRenderingAccountsListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ResourceClient.RemoteRenderingAccountsListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.RemoteRenderingAccountsListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.RemoteRenderingAccountsListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ResourceClient.RemoteRenderingAccountsUpdate` - -```go -ctx := context.TODO() -id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - -payload := resource.RemoteRenderingAccount{ - // ... -} - - -read, err := client.RemoteRenderingAccountsUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ResourceClient.SpatialAnchorsAccountsCreate` - -```go -ctx := context.TODO() -id := resource.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") - -payload := resource.SpatialAnchorsAccount{ - // ... -} - - -read, err := client.SpatialAnchorsAccountsCreate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ResourceClient.SpatialAnchorsAccountsDelete` - -```go -ctx := context.TODO() -id := resource.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") - -read, err := client.SpatialAnchorsAccountsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ResourceClient.SpatialAnchorsAccountsGet` - -```go -ctx := context.TODO() -id := resource.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") - -read, err := client.SpatialAnchorsAccountsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ResourceClient.SpatialAnchorsAccountsListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.SpatialAnchorsAccountsListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.SpatialAnchorsAccountsListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ResourceClient.SpatialAnchorsAccountsListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.SpatialAnchorsAccountsListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.SpatialAnchorsAccountsListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ResourceClient.SpatialAnchorsAccountsUpdate` - -```go -ctx := context.TODO() -id := resource.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") - -payload := resource.SpatialAnchorsAccount{ - // ... -} - - -read, err := client.SpatialAnchorsAccountsUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/resource-manager/mixedreality/2021-01-01/resource/client.go b/resource-manager/mixedreality/2021-01-01/resource/client.go deleted file mode 100644 index 672e189b06e..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package resource - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceClient struct { - Client *resourcemanager.Client -} - -func NewResourceClientWithBaseURI(sdkApi sdkEnv.Api) (*ResourceClient, error) { - client, err := resourcemanager.NewClient(sdkApi, "resource", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ResourceClient: %+v", err) - } - - return &ResourceClient{ - Client: client, - }, nil -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/constants.go b/resource-manager/mixedreality/2021-01-01/resource/constants.go deleted file mode 100644 index 43e22f34c40..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package resource - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SkuTier string - -const ( - SkuTierBasic SkuTier = "Basic" - SkuTierFree SkuTier = "Free" - SkuTierPremium SkuTier = "Premium" - SkuTierStandard SkuTier = "Standard" -) - -func PossibleValuesForSkuTier() []string { - return []string{ - string(SkuTierBasic), - string(SkuTierFree), - string(SkuTierPremium), - string(SkuTierStandard), - } -} - -func (s *SkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSkuTier(input string) (*SkuTier, error) { - vals := map[string]SkuTier{ - "basic": SkuTierBasic, - "free": SkuTierFree, - "premium": SkuTierPremium, - "standard": SkuTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SkuTier(input) - return &out, nil -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount.go b/resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount.go deleted file mode 100644 index 7573ded1718..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount.go +++ /dev/null @@ -1,130 +0,0 @@ -package resource - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&RemoteRenderingAccountId{}) -} - -var _ resourceids.ResourceId = &RemoteRenderingAccountId{} - -// RemoteRenderingAccountId is a struct representing the Resource ID for a Remote Rendering Account -type RemoteRenderingAccountId struct { - SubscriptionId string - ResourceGroupName string - RemoteRenderingAccountName string -} - -// NewRemoteRenderingAccountID returns a new RemoteRenderingAccountId struct -func NewRemoteRenderingAccountID(subscriptionId string, resourceGroupName string, remoteRenderingAccountName string) RemoteRenderingAccountId { - return RemoteRenderingAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RemoteRenderingAccountName: remoteRenderingAccountName, - } -} - -// ParseRemoteRenderingAccountID parses 'input' into a RemoteRenderingAccountId -func ParseRemoteRenderingAccountID(input string) (*RemoteRenderingAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(&RemoteRenderingAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RemoteRenderingAccountId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRemoteRenderingAccountIDInsensitively parses 'input' case-insensitively into a RemoteRenderingAccountId -// note: this method should only be used for API response data and not user input -func ParseRemoteRenderingAccountIDInsensitively(input string) (*RemoteRenderingAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(&RemoteRenderingAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RemoteRenderingAccountId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RemoteRenderingAccountId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RemoteRenderingAccountName, ok = input.Parsed["remoteRenderingAccountName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "remoteRenderingAccountName", input) - } - - return nil -} - -// ValidateRemoteRenderingAccountID checks that 'input' can be parsed as a Remote Rendering Account ID -func ValidateRemoteRenderingAccountID(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 := ParseRemoteRenderingAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Remote Rendering Account ID -func (id RemoteRenderingAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.MixedReality/remoteRenderingAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RemoteRenderingAccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Remote Rendering Account ID -func (id RemoteRenderingAccountId) 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("staticMicrosoftMixedReality", "Microsoft.MixedReality", "Microsoft.MixedReality"), - resourceids.StaticSegment("staticRemoteRenderingAccounts", "remoteRenderingAccounts", "remoteRenderingAccounts"), - resourceids.UserSpecifiedSegment("remoteRenderingAccountName", "remoteRenderingAccountName"), - } -} - -// String returns a human-readable description of this Remote Rendering Account ID -func (id RemoteRenderingAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Remote Rendering Account Name: %q", id.RemoteRenderingAccountName), - } - return fmt.Sprintf("Remote Rendering Account (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount_test.go b/resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount_test.go deleted file mode 100644 index dde33490d8e..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package resource - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ resourceids.ResourceId = &RemoteRenderingAccountId{} - -func TestNewRemoteRenderingAccountID(t *testing.T) { - id := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - - if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") - } - - if id.ResourceGroupName != "example-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") - } - - if id.RemoteRenderingAccountName != "remoteRenderingAccountName" { - t.Fatalf("Expected %q but got %q for Segment 'RemoteRenderingAccountName'", id.RemoteRenderingAccountName, "remoteRenderingAccountName") - } -} - -func TestFormatRemoteRenderingAccountID(t *testing.T) { - actual := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRemoteRenderingAccountID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RemoteRenderingAccountId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName", - Expected: &RemoteRenderingAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RemoteRenderingAccountName: "remoteRenderingAccountName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRemoteRenderingAccountID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.ResourceGroupName != v.Expected.ResourceGroupName { - t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) - } - - if actual.RemoteRenderingAccountName != v.Expected.RemoteRenderingAccountName { - t.Fatalf("Expected %q but got %q for RemoteRenderingAccountName", v.Expected.RemoteRenderingAccountName, actual.RemoteRenderingAccountName) - } - - } -} - -func TestParseRemoteRenderingAccountIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RemoteRenderingAccountId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName", - Expected: &RemoteRenderingAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RemoteRenderingAccountName: "remoteRenderingAccountName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/rEmOtErEnDeRiNgAcCoUnTnAmE", - Expected: &RemoteRenderingAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RemoteRenderingAccountName: "rEmOtErEnDeRiNgAcCoUnTnAmE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/rEmOtErEnDeRiNgAcCoUnTnAmE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRemoteRenderingAccountIDInsensitively(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.ResourceGroupName != v.Expected.ResourceGroupName { - t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) - } - - if actual.RemoteRenderingAccountName != v.Expected.RemoteRenderingAccountName { - t.Fatalf("Expected %q but got %q for RemoteRenderingAccountName", v.Expected.RemoteRenderingAccountName, actual.RemoteRenderingAccountName) - } - - } -} - -func TestSegmentsForRemoteRenderingAccountId(t *testing.T) { - segments := RemoteRenderingAccountId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RemoteRenderingAccountId has no segments") - } - - uniqueNames := make(map[string]struct{}, 0) - for _, segment := range segments { - uniqueNames[segment.Name] = struct{}{} - } - if len(uniqueNames) != len(segments) { - t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) - } -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount.go b/resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount.go deleted file mode 100644 index a0f747252cb..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount.go +++ /dev/null @@ -1,130 +0,0 @@ -package resource - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&SpatialAnchorsAccountId{}) -} - -var _ resourceids.ResourceId = &SpatialAnchorsAccountId{} - -// SpatialAnchorsAccountId is a struct representing the Resource ID for a Spatial Anchors Account -type SpatialAnchorsAccountId struct { - SubscriptionId string - ResourceGroupName string - SpatialAnchorsAccountName string -} - -// NewSpatialAnchorsAccountID returns a new SpatialAnchorsAccountId struct -func NewSpatialAnchorsAccountID(subscriptionId string, resourceGroupName string, spatialAnchorsAccountName string) SpatialAnchorsAccountId { - return SpatialAnchorsAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - SpatialAnchorsAccountName: spatialAnchorsAccountName, - } -} - -// ParseSpatialAnchorsAccountID parses 'input' into a SpatialAnchorsAccountId -func ParseSpatialAnchorsAccountID(input string) (*SpatialAnchorsAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(&SpatialAnchorsAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SpatialAnchorsAccountId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSpatialAnchorsAccountIDInsensitively parses 'input' case-insensitively into a SpatialAnchorsAccountId -// note: this method should only be used for API response data and not user input -func ParseSpatialAnchorsAccountIDInsensitively(input string) (*SpatialAnchorsAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(&SpatialAnchorsAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SpatialAnchorsAccountId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SpatialAnchorsAccountId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.SpatialAnchorsAccountName, ok = input.Parsed["spatialAnchorsAccountName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "spatialAnchorsAccountName", input) - } - - return nil -} - -// ValidateSpatialAnchorsAccountID checks that 'input' can be parsed as a Spatial Anchors Account ID -func ValidateSpatialAnchorsAccountID(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 := ParseSpatialAnchorsAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Spatial Anchors Account ID -func (id SpatialAnchorsAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.MixedReality/spatialAnchorsAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.SpatialAnchorsAccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Spatial Anchors Account ID -func (id SpatialAnchorsAccountId) 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("staticMicrosoftMixedReality", "Microsoft.MixedReality", "Microsoft.MixedReality"), - resourceids.StaticSegment("staticSpatialAnchorsAccounts", "spatialAnchorsAccounts", "spatialAnchorsAccounts"), - resourceids.UserSpecifiedSegment("spatialAnchorsAccountName", "spatialAnchorsAccountName"), - } -} - -// String returns a human-readable description of this Spatial Anchors Account ID -func (id SpatialAnchorsAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Spatial Anchors Account Name: %q", id.SpatialAnchorsAccountName), - } - return fmt.Sprintf("Spatial Anchors Account (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount_test.go b/resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount_test.go deleted file mode 100644 index 7bad3f0cf37..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package resource - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ resourceids.ResourceId = &SpatialAnchorsAccountId{} - -func TestNewSpatialAnchorsAccountID(t *testing.T) { - id := NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") - - if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") - } - - if id.ResourceGroupName != "example-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") - } - - if id.SpatialAnchorsAccountName != "spatialAnchorsAccountName" { - t.Fatalf("Expected %q but got %q for Segment 'SpatialAnchorsAccountName'", id.SpatialAnchorsAccountName, "spatialAnchorsAccountName") - } -} - -func TestFormatSpatialAnchorsAccountID(t *testing.T) { - actual := NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSpatialAnchorsAccountID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SpatialAnchorsAccountId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName", - Expected: &SpatialAnchorsAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - SpatialAnchorsAccountName: "spatialAnchorsAccountName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSpatialAnchorsAccountID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.ResourceGroupName != v.Expected.ResourceGroupName { - t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) - } - - if actual.SpatialAnchorsAccountName != v.Expected.SpatialAnchorsAccountName { - t.Fatalf("Expected %q but got %q for SpatialAnchorsAccountName", v.Expected.SpatialAnchorsAccountName, actual.SpatialAnchorsAccountName) - } - - } -} - -func TestParseSpatialAnchorsAccountIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SpatialAnchorsAccountId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/sPaTiAlAnChOrSaCcOuNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName", - Expected: &SpatialAnchorsAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - SpatialAnchorsAccountName: "spatialAnchorsAccountName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/sPaTiAlAnChOrSaCcOuNtS/sPaTiAlAnChOrSaCcOuNtNaMe", - Expected: &SpatialAnchorsAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpatialAnchorsAccountName: "sPaTiAlAnChOrSaCcOuNtNaMe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/sPaTiAlAnChOrSaCcOuNtS/sPaTiAlAnChOrSaCcOuNtNaMe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSpatialAnchorsAccountIDInsensitively(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.ResourceGroupName != v.Expected.ResourceGroupName { - t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) - } - - if actual.SpatialAnchorsAccountName != v.Expected.SpatialAnchorsAccountName { - t.Fatalf("Expected %q but got %q for SpatialAnchorsAccountName", v.Expected.SpatialAnchorsAccountName, actual.SpatialAnchorsAccountName) - } - - } -} - -func TestSegmentsForSpatialAnchorsAccountId(t *testing.T) { - segments := SpatialAnchorsAccountId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SpatialAnchorsAccountId has no segments") - } - - uniqueNames := make(map[string]struct{}, 0) - for _, segment := range segments { - uniqueNames[segment.Name] = struct{}{} - } - if len(uniqueNames) != len(segments) { - t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) - } -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountscreate.go b/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountscreate.go deleted file mode 100644 index 570a9c1a924..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountscreate.go +++ /dev/null @@ -1,58 +0,0 @@ -package resource - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsCreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RemoteRenderingAccount -} - -// RemoteRenderingAccountsCreate ... -func (c ResourceClient) RemoteRenderingAccountsCreate(ctx context.Context, id RemoteRenderingAccountId, input RemoteRenderingAccount) (result RemoteRenderingAccountsCreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model RemoteRenderingAccount - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountsdelete.go b/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountsdelete.go deleted file mode 100644 index d92a1ed8507..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountsdelete.go +++ /dev/null @@ -1,47 +0,0 @@ -package resource - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsDeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// RemoteRenderingAccountsDelete ... -func (c ResourceClient) RemoteRenderingAccountsDelete(ctx context.Context, id RemoteRenderingAccountId) (result RemoteRenderingAccountsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountsget.go b/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountsget.go deleted file mode 100644 index d60c553dd77..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountsget.go +++ /dev/null @@ -1,53 +0,0 @@ -package resource - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RemoteRenderingAccount -} - -// RemoteRenderingAccountsGet ... -func (c ResourceClient) RemoteRenderingAccountsGet(ctx context.Context, id RemoteRenderingAccountId) (result RemoteRenderingAccountsGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model RemoteRenderingAccount - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountslistbyresourcegroup.go b/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountslistbyresourcegroup.go deleted file mode 100644 index 3a0baec90fa..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountslistbyresourcegroup.go +++ /dev/null @@ -1,106 +0,0 @@ -package resource - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RemoteRenderingAccount -} - -type RemoteRenderingAccountsListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []RemoteRenderingAccount -} - -type RemoteRenderingAccountsListByResourceGroupCustomPager struct { - NextLink *odata.Link `json:"nextLink"` -} - -func (p *RemoteRenderingAccountsListByResourceGroupCustomPager) NextPageLink() *odata.Link { - defer func() { - p.NextLink = nil - }() - - return p.NextLink -} - -// RemoteRenderingAccountsListByResourceGroup ... -func (c ResourceClient) RemoteRenderingAccountsListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result RemoteRenderingAccountsListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Pager: &RemoteRenderingAccountsListByResourceGroupCustomPager{}, - Path: fmt.Sprintf("%s/providers/Microsoft.MixedReality/remoteRenderingAccounts", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]RemoteRenderingAccount `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// RemoteRenderingAccountsListByResourceGroupComplete retrieves all the results into a single object -func (c ResourceClient) RemoteRenderingAccountsListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (RemoteRenderingAccountsListByResourceGroupCompleteResult, error) { - return c.RemoteRenderingAccountsListByResourceGroupCompleteMatchingPredicate(ctx, id, RemoteRenderingAccountOperationPredicate{}) -} - -// RemoteRenderingAccountsListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ResourceClient) RemoteRenderingAccountsListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate RemoteRenderingAccountOperationPredicate) (result RemoteRenderingAccountsListByResourceGroupCompleteResult, err error) { - items := make([]RemoteRenderingAccount, 0) - - resp, err := c.RemoteRenderingAccountsListByResourceGroup(ctx, id) - if err != nil { - result.LatestHttpResponse = resp.HttpResponse - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = RemoteRenderingAccountsListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountslistbysubscription.go b/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountslistbysubscription.go deleted file mode 100644 index 05a16e1bcc4..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountslistbysubscription.go +++ /dev/null @@ -1,106 +0,0 @@ -package resource - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RemoteRenderingAccount -} - -type RemoteRenderingAccountsListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []RemoteRenderingAccount -} - -type RemoteRenderingAccountsListBySubscriptionCustomPager struct { - NextLink *odata.Link `json:"nextLink"` -} - -func (p *RemoteRenderingAccountsListBySubscriptionCustomPager) NextPageLink() *odata.Link { - defer func() { - p.NextLink = nil - }() - - return p.NextLink -} - -// RemoteRenderingAccountsListBySubscription ... -func (c ResourceClient) RemoteRenderingAccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result RemoteRenderingAccountsListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Pager: &RemoteRenderingAccountsListBySubscriptionCustomPager{}, - Path: fmt.Sprintf("%s/providers/Microsoft.MixedReality/remoteRenderingAccounts", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]RemoteRenderingAccount `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// RemoteRenderingAccountsListBySubscriptionComplete retrieves all the results into a single object -func (c ResourceClient) RemoteRenderingAccountsListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (RemoteRenderingAccountsListBySubscriptionCompleteResult, error) { - return c.RemoteRenderingAccountsListBySubscriptionCompleteMatchingPredicate(ctx, id, RemoteRenderingAccountOperationPredicate{}) -} - -// RemoteRenderingAccountsListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ResourceClient) RemoteRenderingAccountsListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate RemoteRenderingAccountOperationPredicate) (result RemoteRenderingAccountsListBySubscriptionCompleteResult, err error) { - items := make([]RemoteRenderingAccount, 0) - - resp, err := c.RemoteRenderingAccountsListBySubscription(ctx, id) - if err != nil { - result.LatestHttpResponse = resp.HttpResponse - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = RemoteRenderingAccountsListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountsupdate.go b/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountsupdate.go deleted file mode 100644 index a690cc24266..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/method_remoterenderingaccountsupdate.go +++ /dev/null @@ -1,57 +0,0 @@ -package resource - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RemoteRenderingAccount -} - -// RemoteRenderingAccountsUpdate ... -func (c ResourceClient) RemoteRenderingAccountsUpdate(ctx context.Context, id RemoteRenderingAccountId, input RemoteRenderingAccount) (result RemoteRenderingAccountsUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model RemoteRenderingAccount - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountscreate.go b/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountscreate.go deleted file mode 100644 index cef260075fa..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountscreate.go +++ /dev/null @@ -1,58 +0,0 @@ -package resource - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SpatialAnchorsAccountsCreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SpatialAnchorsAccount -} - -// SpatialAnchorsAccountsCreate ... -func (c ResourceClient) SpatialAnchorsAccountsCreate(ctx context.Context, id SpatialAnchorsAccountId, input SpatialAnchorsAccount) (result SpatialAnchorsAccountsCreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model SpatialAnchorsAccount - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountsdelete.go b/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountsdelete.go deleted file mode 100644 index e149bb25c90..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountsdelete.go +++ /dev/null @@ -1,47 +0,0 @@ -package resource - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SpatialAnchorsAccountsDeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// SpatialAnchorsAccountsDelete ... -func (c ResourceClient) SpatialAnchorsAccountsDelete(ctx context.Context, id SpatialAnchorsAccountId) (result SpatialAnchorsAccountsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountsget.go b/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountsget.go deleted file mode 100644 index 8c5b5c7d19d..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountsget.go +++ /dev/null @@ -1,53 +0,0 @@ -package resource - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SpatialAnchorsAccountsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SpatialAnchorsAccount -} - -// SpatialAnchorsAccountsGet ... -func (c ResourceClient) SpatialAnchorsAccountsGet(ctx context.Context, id SpatialAnchorsAccountId) (result SpatialAnchorsAccountsGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model SpatialAnchorsAccount - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountslistbyresourcegroup.go b/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountslistbyresourcegroup.go deleted file mode 100644 index 55cfb9d2b2e..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountslistbyresourcegroup.go +++ /dev/null @@ -1,106 +0,0 @@ -package resource - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SpatialAnchorsAccountsListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]SpatialAnchorsAccount -} - -type SpatialAnchorsAccountsListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []SpatialAnchorsAccount -} - -type SpatialAnchorsAccountsListByResourceGroupCustomPager struct { - NextLink *odata.Link `json:"nextLink"` -} - -func (p *SpatialAnchorsAccountsListByResourceGroupCustomPager) NextPageLink() *odata.Link { - defer func() { - p.NextLink = nil - }() - - return p.NextLink -} - -// SpatialAnchorsAccountsListByResourceGroup ... -func (c ResourceClient) SpatialAnchorsAccountsListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result SpatialAnchorsAccountsListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Pager: &SpatialAnchorsAccountsListByResourceGroupCustomPager{}, - Path: fmt.Sprintf("%s/providers/Microsoft.MixedReality/spatialAnchorsAccounts", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]SpatialAnchorsAccount `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// SpatialAnchorsAccountsListByResourceGroupComplete retrieves all the results into a single object -func (c ResourceClient) SpatialAnchorsAccountsListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (SpatialAnchorsAccountsListByResourceGroupCompleteResult, error) { - return c.SpatialAnchorsAccountsListByResourceGroupCompleteMatchingPredicate(ctx, id, SpatialAnchorsAccountOperationPredicate{}) -} - -// SpatialAnchorsAccountsListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ResourceClient) SpatialAnchorsAccountsListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate SpatialAnchorsAccountOperationPredicate) (result SpatialAnchorsAccountsListByResourceGroupCompleteResult, err error) { - items := make([]SpatialAnchorsAccount, 0) - - resp, err := c.SpatialAnchorsAccountsListByResourceGroup(ctx, id) - if err != nil { - result.LatestHttpResponse = resp.HttpResponse - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = SpatialAnchorsAccountsListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountslistbysubscription.go b/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountslistbysubscription.go deleted file mode 100644 index ac6a1ca1121..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountslistbysubscription.go +++ /dev/null @@ -1,106 +0,0 @@ -package resource - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SpatialAnchorsAccountsListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]SpatialAnchorsAccount -} - -type SpatialAnchorsAccountsListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []SpatialAnchorsAccount -} - -type SpatialAnchorsAccountsListBySubscriptionCustomPager struct { - NextLink *odata.Link `json:"nextLink"` -} - -func (p *SpatialAnchorsAccountsListBySubscriptionCustomPager) NextPageLink() *odata.Link { - defer func() { - p.NextLink = nil - }() - - return p.NextLink -} - -// SpatialAnchorsAccountsListBySubscription ... -func (c ResourceClient) SpatialAnchorsAccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result SpatialAnchorsAccountsListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Pager: &SpatialAnchorsAccountsListBySubscriptionCustomPager{}, - Path: fmt.Sprintf("%s/providers/Microsoft.MixedReality/spatialAnchorsAccounts", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]SpatialAnchorsAccount `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// SpatialAnchorsAccountsListBySubscriptionComplete retrieves all the results into a single object -func (c ResourceClient) SpatialAnchorsAccountsListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (SpatialAnchorsAccountsListBySubscriptionCompleteResult, error) { - return c.SpatialAnchorsAccountsListBySubscriptionCompleteMatchingPredicate(ctx, id, SpatialAnchorsAccountOperationPredicate{}) -} - -// SpatialAnchorsAccountsListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ResourceClient) SpatialAnchorsAccountsListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate SpatialAnchorsAccountOperationPredicate) (result SpatialAnchorsAccountsListBySubscriptionCompleteResult, err error) { - items := make([]SpatialAnchorsAccount, 0) - - resp, err := c.SpatialAnchorsAccountsListBySubscription(ctx, id) - if err != nil { - result.LatestHttpResponse = resp.HttpResponse - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = SpatialAnchorsAccountsListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountsupdate.go b/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountsupdate.go deleted file mode 100644 index e470cb48f54..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/method_spatialanchorsaccountsupdate.go +++ /dev/null @@ -1,57 +0,0 @@ -package resource - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SpatialAnchorsAccountsUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SpatialAnchorsAccount -} - -// SpatialAnchorsAccountsUpdate ... -func (c ResourceClient) SpatialAnchorsAccountsUpdate(ctx context.Context, id SpatialAnchorsAccountId, input SpatialAnchorsAccount) (result SpatialAnchorsAccountsUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model SpatialAnchorsAccount - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/model_mixedrealityaccountproperties.go b/resource-manager/mixedreality/2021-01-01/resource/model_mixedrealityaccountproperties.go deleted file mode 100644 index 38d0a1ed639..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/model_mixedrealityaccountproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package resource - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MixedRealityAccountProperties struct { - AccountDomain *string `json:"accountDomain,omitempty"` - AccountId *string `json:"accountId,omitempty"` - StorageAccountName *string `json:"storageAccountName,omitempty"` -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/model_remoterenderingaccount.go b/resource-manager/mixedreality/2021-01-01/resource/model_remoterenderingaccount.go deleted file mode 100644 index 976e458637d..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/model_remoterenderingaccount.go +++ /dev/null @@ -1,23 +0,0 @@ -package resource - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccount struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemAssigned `json:"identity,omitempty"` - Kind *Sku `json:"kind,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Plan *identity.SystemAssigned `json:"plan,omitempty"` - Properties *MixedRealityAccountProperties `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/resource-manager/mixedreality/2021-01-01/resource/model_sku.go b/resource-manager/mixedreality/2021-01-01/resource/model_sku.go deleted file mode 100644 index 182c316eff9..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/model_sku.go +++ /dev/null @@ -1,12 +0,0 @@ -package resource - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Sku struct { - Capacity *int64 `json:"capacity,omitempty"` - Family *string `json:"family,omitempty"` - Name string `json:"name"` - Size *string `json:"size,omitempty"` - Tier *SkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/model_spatialanchorsaccount.go b/resource-manager/mixedreality/2021-01-01/resource/model_spatialanchorsaccount.go deleted file mode 100644 index 0aadd7c7371..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/model_spatialanchorsaccount.go +++ /dev/null @@ -1,23 +0,0 @@ -package resource - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SpatialAnchorsAccount struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemAssigned `json:"identity,omitempty"` - Kind *Sku `json:"kind,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Plan *identity.SystemAssigned `json:"plan,omitempty"` - Properties *MixedRealityAccountProperties `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/resource-manager/mixedreality/2021-01-01/resource/predicates.go b/resource-manager/mixedreality/2021-01-01/resource/predicates.go deleted file mode 100644 index 0a87dca95da..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/predicates.go +++ /dev/null @@ -1,60 +0,0 @@ -package resource - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p RemoteRenderingAccountOperationPredicate) Matches(input RemoteRenderingAccount) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} - -type SpatialAnchorsAccountOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p SpatialAnchorsAccountOperationPredicate) Matches(input SpatialAnchorsAccount) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/resource-manager/mixedreality/2021-01-01/resource/version.go b/resource-manager/mixedreality/2021-01-01/resource/version.go deleted file mode 100644 index 824746a39fa..00000000000 --- a/resource-manager/mixedreality/2021-01-01/resource/version.go +++ /dev/null @@ -1,10 +0,0 @@ -package resource - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-01-01" - -func userAgent() string { - return "hashicorp/go-azure-sdk/resource/2021-01-01" -} diff --git a/resource-manager/mixedreality/2025-01-01/client.go b/resource-manager/mixedreality/2025-01-01/client.go deleted file mode 100644 index 6f93ed2fc50..00000000000 --- a/resource-manager/mixedreality/2025-01-01/client.go +++ /dev/null @@ -1,46 +0,0 @@ -package v2025_01_01 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2025-01-01/key" - "github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2025-01-01/proxy" - "github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2025-01-01/resource" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - Key *key.KeyClient - Proxy *proxy.ProxyClient - Resource *resource.ResourceClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - keyClient, err := key.NewKeyClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Key client: %+v", err) - } - configureFunc(keyClient.Client) - - proxyClient, err := proxy.NewProxyClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Proxy client: %+v", err) - } - configureFunc(proxyClient.Client) - - resourceClient, err := resource.NewResourceClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Resource client: %+v", err) - } - configureFunc(resourceClient.Client) - - return &Client{ - Key: keyClient, - Proxy: proxyClient, - Resource: resourceClient, - }, nil -} diff --git a/resource-manager/mixedreality/2025-01-01/key/README.md b/resource-manager/mixedreality/2025-01-01/key/README.md deleted file mode 100644 index f82cc637e61..00000000000 --- a/resource-manager/mixedreality/2025-01-01/key/README.md +++ /dev/null @@ -1,57 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2025-01-01/key` Documentation - -The `key` SDK allows for interaction with Azure Resource Manager `mixedreality` (API Version `2025-01-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/mixedreality/2025-01-01/key" -``` - - -### Client Initialization - -```go -client := key.NewKeyClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `KeyClient.RemoteRenderingAccountsListKeys` - -```go -ctx := context.TODO() -id := key.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - -read, err := client.RemoteRenderingAccountsListKeys(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `KeyClient.RemoteRenderingAccountsRegenerateKeys` - -```go -ctx := context.TODO() -id := key.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - -payload := key.AccountKeyRegenerateRequest{ - // ... -} - - -read, err := client.RemoteRenderingAccountsRegenerateKeys(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/resource-manager/mixedreality/2025-01-01/key/client.go b/resource-manager/mixedreality/2025-01-01/key/client.go deleted file mode 100644 index 3c29cfe2291..00000000000 --- a/resource-manager/mixedreality/2025-01-01/key/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package key - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KeyClient struct { - Client *resourcemanager.Client -} - -func NewKeyClientWithBaseURI(sdkApi sdkEnv.Api) (*KeyClient, error) { - client, err := resourcemanager.NewClient(sdkApi, "key", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating KeyClient: %+v", err) - } - - return &KeyClient{ - Client: client, - }, nil -} diff --git a/resource-manager/mixedreality/2025-01-01/key/constants.go b/resource-manager/mixedreality/2025-01-01/key/constants.go deleted file mode 100644 index 4dc132d61a1..00000000000 --- a/resource-manager/mixedreality/2025-01-01/key/constants.go +++ /dev/null @@ -1,18 +0,0 @@ -package key - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Serial int64 - -const ( - SerialPrimary Serial = 1 - SerialSecondary Serial = 2 -) - -func PossibleValuesForSerial() []int64 { - return []int64{ - int64(SerialPrimary), - int64(SerialSecondary), - } -} diff --git a/resource-manager/mixedreality/2025-01-01/key/id_remoterenderingaccount.go b/resource-manager/mixedreality/2025-01-01/key/id_remoterenderingaccount.go deleted file mode 100644 index e9f8cd8d3d7..00000000000 --- a/resource-manager/mixedreality/2025-01-01/key/id_remoterenderingaccount.go +++ /dev/null @@ -1,130 +0,0 @@ -package key - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&RemoteRenderingAccountId{}) -} - -var _ resourceids.ResourceId = &RemoteRenderingAccountId{} - -// RemoteRenderingAccountId is a struct representing the Resource ID for a Remote Rendering Account -type RemoteRenderingAccountId struct { - SubscriptionId string - ResourceGroupName string - RemoteRenderingAccountName string -} - -// NewRemoteRenderingAccountID returns a new RemoteRenderingAccountId struct -func NewRemoteRenderingAccountID(subscriptionId string, resourceGroupName string, remoteRenderingAccountName string) RemoteRenderingAccountId { - return RemoteRenderingAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RemoteRenderingAccountName: remoteRenderingAccountName, - } -} - -// ParseRemoteRenderingAccountID parses 'input' into a RemoteRenderingAccountId -func ParseRemoteRenderingAccountID(input string) (*RemoteRenderingAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(&RemoteRenderingAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RemoteRenderingAccountId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRemoteRenderingAccountIDInsensitively parses 'input' case-insensitively into a RemoteRenderingAccountId -// note: this method should only be used for API response data and not user input -func ParseRemoteRenderingAccountIDInsensitively(input string) (*RemoteRenderingAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(&RemoteRenderingAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RemoteRenderingAccountId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RemoteRenderingAccountId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RemoteRenderingAccountName, ok = input.Parsed["remoteRenderingAccountName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "remoteRenderingAccountName", input) - } - - return nil -} - -// ValidateRemoteRenderingAccountID checks that 'input' can be parsed as a Remote Rendering Account ID -func ValidateRemoteRenderingAccountID(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 := ParseRemoteRenderingAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Remote Rendering Account ID -func (id RemoteRenderingAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.MixedReality/remoteRenderingAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RemoteRenderingAccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Remote Rendering Account ID -func (id RemoteRenderingAccountId) 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("staticMicrosoftMixedReality", "Microsoft.MixedReality", "Microsoft.MixedReality"), - resourceids.StaticSegment("staticRemoteRenderingAccounts", "remoteRenderingAccounts", "remoteRenderingAccounts"), - resourceids.UserSpecifiedSegment("remoteRenderingAccountName", "remoteRenderingAccountName"), - } -} - -// String returns a human-readable description of this Remote Rendering Account ID -func (id RemoteRenderingAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Remote Rendering Account Name: %q", id.RemoteRenderingAccountName), - } - return fmt.Sprintf("Remote Rendering Account (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/mixedreality/2025-01-01/key/id_remoterenderingaccount_test.go b/resource-manager/mixedreality/2025-01-01/key/id_remoterenderingaccount_test.go deleted file mode 100644 index 8a5b61d9e4c..00000000000 --- a/resource-manager/mixedreality/2025-01-01/key/id_remoterenderingaccount_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package key - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ resourceids.ResourceId = &RemoteRenderingAccountId{} - -func TestNewRemoteRenderingAccountID(t *testing.T) { - id := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - - if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") - } - - if id.ResourceGroupName != "example-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") - } - - if id.RemoteRenderingAccountName != "remoteRenderingAccountName" { - t.Fatalf("Expected %q but got %q for Segment 'RemoteRenderingAccountName'", id.RemoteRenderingAccountName, "remoteRenderingAccountName") - } -} - -func TestFormatRemoteRenderingAccountID(t *testing.T) { - actual := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRemoteRenderingAccountID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RemoteRenderingAccountId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName", - Expected: &RemoteRenderingAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RemoteRenderingAccountName: "remoteRenderingAccountName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRemoteRenderingAccountID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.ResourceGroupName != v.Expected.ResourceGroupName { - t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) - } - - if actual.RemoteRenderingAccountName != v.Expected.RemoteRenderingAccountName { - t.Fatalf("Expected %q but got %q for RemoteRenderingAccountName", v.Expected.RemoteRenderingAccountName, actual.RemoteRenderingAccountName) - } - - } -} - -func TestParseRemoteRenderingAccountIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RemoteRenderingAccountId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName", - Expected: &RemoteRenderingAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RemoteRenderingAccountName: "remoteRenderingAccountName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/rEmOtErEnDeRiNgAcCoUnTnAmE", - Expected: &RemoteRenderingAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RemoteRenderingAccountName: "rEmOtErEnDeRiNgAcCoUnTnAmE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/rEmOtErEnDeRiNgAcCoUnTnAmE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRemoteRenderingAccountIDInsensitively(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.ResourceGroupName != v.Expected.ResourceGroupName { - t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) - } - - if actual.RemoteRenderingAccountName != v.Expected.RemoteRenderingAccountName { - t.Fatalf("Expected %q but got %q for RemoteRenderingAccountName", v.Expected.RemoteRenderingAccountName, actual.RemoteRenderingAccountName) - } - - } -} - -func TestSegmentsForRemoteRenderingAccountId(t *testing.T) { - segments := RemoteRenderingAccountId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RemoteRenderingAccountId has no segments") - } - - uniqueNames := make(map[string]struct{}, 0) - for _, segment := range segments { - uniqueNames[segment.Name] = struct{}{} - } - if len(uniqueNames) != len(segments) { - t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) - } -} diff --git a/resource-manager/mixedreality/2025-01-01/key/method_remoterenderingaccountslistkeys.go b/resource-manager/mixedreality/2025-01-01/key/method_remoterenderingaccountslistkeys.go deleted file mode 100644 index 6fc308963e4..00000000000 --- a/resource-manager/mixedreality/2025-01-01/key/method_remoterenderingaccountslistkeys.go +++ /dev/null @@ -1,54 +0,0 @@ -package key - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsListKeysOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AccountKeys -} - -// RemoteRenderingAccountsListKeys ... -func (c KeyClient) RemoteRenderingAccountsListKeys(ctx context.Context, id RemoteRenderingAccountId) (result RemoteRenderingAccountsListKeysOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listKeys", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model AccountKeys - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2025-01-01/key/method_remoterenderingaccountsregeneratekeys.go b/resource-manager/mixedreality/2025-01-01/key/method_remoterenderingaccountsregeneratekeys.go deleted file mode 100644 index f8d284d7099..00000000000 --- a/resource-manager/mixedreality/2025-01-01/key/method_remoterenderingaccountsregeneratekeys.go +++ /dev/null @@ -1,58 +0,0 @@ -package key - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsRegenerateKeysOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AccountKeys -} - -// RemoteRenderingAccountsRegenerateKeys ... -func (c KeyClient) RemoteRenderingAccountsRegenerateKeys(ctx context.Context, id RemoteRenderingAccountId, input AccountKeyRegenerateRequest) (result RemoteRenderingAccountsRegenerateKeysOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/regenerateKeys", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model AccountKeys - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2025-01-01/key/model_accountkeyregeneraterequest.go b/resource-manager/mixedreality/2025-01-01/key/model_accountkeyregeneraterequest.go deleted file mode 100644 index a16d03f1419..00000000000 --- a/resource-manager/mixedreality/2025-01-01/key/model_accountkeyregeneraterequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package key - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountKeyRegenerateRequest struct { - Serial *Serial `json:"serial,omitempty"` -} diff --git a/resource-manager/mixedreality/2025-01-01/key/model_accountkeys.go b/resource-manager/mixedreality/2025-01-01/key/model_accountkeys.go deleted file mode 100644 index 30dec438536..00000000000 --- a/resource-manager/mixedreality/2025-01-01/key/model_accountkeys.go +++ /dev/null @@ -1,9 +0,0 @@ -package key - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountKeys struct { - PrimaryKey *string `json:"primaryKey,omitempty"` - SecondaryKey *string `json:"secondaryKey,omitempty"` -} diff --git a/resource-manager/mixedreality/2025-01-01/key/version.go b/resource-manager/mixedreality/2025-01-01/key/version.go deleted file mode 100644 index db79882de2c..00000000000 --- a/resource-manager/mixedreality/2025-01-01/key/version.go +++ /dev/null @@ -1,10 +0,0 @@ -package key - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2025-01-01" - -func userAgent() string { - return "hashicorp/go-azure-sdk/key/2025-01-01" -} diff --git a/resource-manager/mixedreality/2025-01-01/proxy/README.md b/resource-manager/mixedreality/2025-01-01/proxy/README.md deleted file mode 100644 index e44b6c62b0a..00000000000 --- a/resource-manager/mixedreality/2025-01-01/proxy/README.md +++ /dev/null @@ -1,59 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2025-01-01/proxy` Documentation - -The `proxy` SDK allows for interaction with Azure Resource Manager `mixedreality` (API Version `2025-01-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2025-01-01/proxy" -``` - - -### Client Initialization - -```go -client := proxy.NewProxyClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ProxyClient.CheckNameAvailabilityLocal` - -```go -ctx := context.TODO() -id := proxy.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") - -payload := proxy.CheckNameAvailabilityRequest{ - // ... -} - - -read, err := client.CheckNameAvailabilityLocal(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ProxyClient.RemoteRenderingAccountsListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.RemoteRenderingAccountsListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.RemoteRenderingAccountsListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/mixedreality/2025-01-01/proxy/client.go b/resource-manager/mixedreality/2025-01-01/proxy/client.go deleted file mode 100644 index daaef6e0be4..00000000000 --- a/resource-manager/mixedreality/2025-01-01/proxy/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package proxy - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ProxyClient struct { - Client *resourcemanager.Client -} - -func NewProxyClientWithBaseURI(sdkApi sdkEnv.Api) (*ProxyClient, error) { - client, err := resourcemanager.NewClient(sdkApi, "proxy", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ProxyClient: %+v", err) - } - - return &ProxyClient{ - Client: client, - }, nil -} diff --git a/resource-manager/mixedreality/2025-01-01/proxy/constants.go b/resource-manager/mixedreality/2025-01-01/proxy/constants.go deleted file mode 100644 index 99e9fd6d941..00000000000 --- a/resource-manager/mixedreality/2025-01-01/proxy/constants.go +++ /dev/null @@ -1,98 +0,0 @@ -package proxy - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NameUnavailableReason string - -const ( - NameUnavailableReasonAlreadyExists NameUnavailableReason = "AlreadyExists" - NameUnavailableReasonInvalid NameUnavailableReason = "Invalid" -) - -func PossibleValuesForNameUnavailableReason() []string { - return []string{ - string(NameUnavailableReasonAlreadyExists), - string(NameUnavailableReasonInvalid), - } -} - -func (s *NameUnavailableReason) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNameUnavailableReason(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNameUnavailableReason(input string) (*NameUnavailableReason, error) { - vals := map[string]NameUnavailableReason{ - "alreadyexists": NameUnavailableReasonAlreadyExists, - "invalid": NameUnavailableReasonInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NameUnavailableReason(input) - return &out, nil -} - -type SkuTier string - -const ( - SkuTierBasic SkuTier = "Basic" - SkuTierFree SkuTier = "Free" - SkuTierPremium SkuTier = "Premium" - SkuTierStandard SkuTier = "Standard" -) - -func PossibleValuesForSkuTier() []string { - return []string{ - string(SkuTierBasic), - string(SkuTierFree), - string(SkuTierPremium), - string(SkuTierStandard), - } -} - -func (s *SkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSkuTier(input string) (*SkuTier, error) { - vals := map[string]SkuTier{ - "basic": SkuTierBasic, - "free": SkuTierFree, - "premium": SkuTierPremium, - "standard": SkuTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SkuTier(input) - return &out, nil -} diff --git a/resource-manager/mixedreality/2025-01-01/proxy/id_location.go b/resource-manager/mixedreality/2025-01-01/proxy/id_location.go deleted file mode 100644 index 66ee4faa862..00000000000 --- a/resource-manager/mixedreality/2025-01-01/proxy/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package proxy - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&LocationId{}) -} - -var _ resourceids.ResourceId = &LocationId{} - -// LocationId is a struct representing the Resource ID for a Location -type LocationId struct { - SubscriptionId string - LocationName string -} - -// NewLocationID returns a new LocationId struct -func NewLocationID(subscriptionId string, locationName string) LocationId { - return LocationId{ - SubscriptionId: subscriptionId, - LocationName: locationName, - } -} - -// ParseLocationID parses 'input' into a LocationId -func ParseLocationID(input string) (*LocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&LocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LocationId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId -// note: this method should only be used for API response data and not user input -func ParseLocationIDInsensitively(input string) (*LocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&LocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LocationId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LocationId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateLocationID checks that 'input' can be parsed as a Location ID -func ValidateLocationID(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 := ParseLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Location ID -func (id LocationId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.MixedReality/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Location ID -func (id LocationId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftMixedReality", "Microsoft.MixedReality", "Microsoft.MixedReality"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationName"), - } -} - -// String returns a human-readable description of this Location ID -func (id LocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/mixedreality/2025-01-01/proxy/id_location_test.go b/resource-manager/mixedreality/2025-01-01/proxy/id_location_test.go deleted file mode 100644 index b8f94aa21f4..00000000000 --- a/resource-manager/mixedreality/2025-01-01/proxy/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package proxy - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ resourceids.ResourceId = &LocationId{} - -func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") - - if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") - } - - if id.LocationName != "locationName" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LocationId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLocationID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LocationId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/lOcAtIoNs/lOcAtIoNnAmE", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNnAmE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/lOcAtIoNs/lOcAtIoNnAmE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLocationIDInsensitively(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForLocationId(t *testing.T) { - segments := LocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LocationId has no segments") - } - - uniqueNames := make(map[string]struct{}, 0) - for _, segment := range segments { - uniqueNames[segment.Name] = struct{}{} - } - if len(uniqueNames) != len(segments) { - t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) - } -} diff --git a/resource-manager/mixedreality/2025-01-01/proxy/method_checknameavailabilitylocal.go b/resource-manager/mixedreality/2025-01-01/proxy/method_checknameavailabilitylocal.go deleted file mode 100644 index 6b96e01a34e..00000000000 --- a/resource-manager/mixedreality/2025-01-01/proxy/method_checknameavailabilitylocal.go +++ /dev/null @@ -1,58 +0,0 @@ -package proxy - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckNameAvailabilityLocalOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CheckNameAvailabilityResponse -} - -// CheckNameAvailabilityLocal ... -func (c ProxyClient) CheckNameAvailabilityLocal(ctx context.Context, id LocationId, input CheckNameAvailabilityRequest) (result CheckNameAvailabilityLocalOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/checkNameAvailability", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model CheckNameAvailabilityResponse - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2025-01-01/proxy/method_remoterenderingaccountslistbysubscription.go b/resource-manager/mixedreality/2025-01-01/proxy/method_remoterenderingaccountslistbysubscription.go deleted file mode 100644 index ced116976a6..00000000000 --- a/resource-manager/mixedreality/2025-01-01/proxy/method_remoterenderingaccountslistbysubscription.go +++ /dev/null @@ -1,106 +0,0 @@ -package proxy - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RemoteRenderingAccount -} - -type RemoteRenderingAccountsListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []RemoteRenderingAccount -} - -type RemoteRenderingAccountsListBySubscriptionCustomPager struct { - NextLink *odata.Link `json:"nextLink"` -} - -func (p *RemoteRenderingAccountsListBySubscriptionCustomPager) NextPageLink() *odata.Link { - defer func() { - p.NextLink = nil - }() - - return p.NextLink -} - -// RemoteRenderingAccountsListBySubscription ... -func (c ProxyClient) RemoteRenderingAccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result RemoteRenderingAccountsListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Pager: &RemoteRenderingAccountsListBySubscriptionCustomPager{}, - Path: fmt.Sprintf("%s/providers/Microsoft.MixedReality/remoteRenderingAccounts", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]RemoteRenderingAccount `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// RemoteRenderingAccountsListBySubscriptionComplete retrieves all the results into a single object -func (c ProxyClient) RemoteRenderingAccountsListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (RemoteRenderingAccountsListBySubscriptionCompleteResult, error) { - return c.RemoteRenderingAccountsListBySubscriptionCompleteMatchingPredicate(ctx, id, RemoteRenderingAccountOperationPredicate{}) -} - -// RemoteRenderingAccountsListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ProxyClient) RemoteRenderingAccountsListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate RemoteRenderingAccountOperationPredicate) (result RemoteRenderingAccountsListBySubscriptionCompleteResult, err error) { - items := make([]RemoteRenderingAccount, 0) - - resp, err := c.RemoteRenderingAccountsListBySubscription(ctx, id) - if err != nil { - result.LatestHttpResponse = resp.HttpResponse - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = RemoteRenderingAccountsListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/mixedreality/2025-01-01/proxy/model_checknameavailabilityrequest.go b/resource-manager/mixedreality/2025-01-01/proxy/model_checknameavailabilityrequest.go deleted file mode 100644 index b34ef86abe3..00000000000 --- a/resource-manager/mixedreality/2025-01-01/proxy/model_checknameavailabilityrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package proxy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckNameAvailabilityRequest struct { - Name string `json:"name"` - Type string `json:"type"` -} diff --git a/resource-manager/mixedreality/2025-01-01/proxy/model_checknameavailabilityresponse.go b/resource-manager/mixedreality/2025-01-01/proxy/model_checknameavailabilityresponse.go deleted file mode 100644 index 70286c7568c..00000000000 --- a/resource-manager/mixedreality/2025-01-01/proxy/model_checknameavailabilityresponse.go +++ /dev/null @@ -1,10 +0,0 @@ -package proxy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckNameAvailabilityResponse struct { - Message *string `json:"message,omitempty"` - NameAvailable bool `json:"nameAvailable"` - Reason *NameUnavailableReason `json:"reason,omitempty"` -} diff --git a/resource-manager/mixedreality/2025-01-01/proxy/model_mixedrealityaccountproperties.go b/resource-manager/mixedreality/2025-01-01/proxy/model_mixedrealityaccountproperties.go deleted file mode 100644 index cfd4f9c3667..00000000000 --- a/resource-manager/mixedreality/2025-01-01/proxy/model_mixedrealityaccountproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package proxy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MixedRealityAccountProperties struct { - AccountDomain *string `json:"accountDomain,omitempty"` - AccountId *string `json:"accountId,omitempty"` - StorageAccountName *string `json:"storageAccountName,omitempty"` -} diff --git a/resource-manager/mixedreality/2025-01-01/proxy/model_remoterenderingaccount.go b/resource-manager/mixedreality/2025-01-01/proxy/model_remoterenderingaccount.go deleted file mode 100644 index 69a58208232..00000000000 --- a/resource-manager/mixedreality/2025-01-01/proxy/model_remoterenderingaccount.go +++ /dev/null @@ -1,23 +0,0 @@ -package proxy - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccount struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemAssigned `json:"identity,omitempty"` - Kind *Sku `json:"kind,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Plan *identity.SystemAssigned `json:"plan,omitempty"` - Properties *MixedRealityAccountProperties `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/resource-manager/mixedreality/2025-01-01/proxy/model_sku.go b/resource-manager/mixedreality/2025-01-01/proxy/model_sku.go deleted file mode 100644 index 808f70e8e4f..00000000000 --- a/resource-manager/mixedreality/2025-01-01/proxy/model_sku.go +++ /dev/null @@ -1,12 +0,0 @@ -package proxy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Sku struct { - Capacity *int64 `json:"capacity,omitempty"` - Family *string `json:"family,omitempty"` - Name string `json:"name"` - Size *string `json:"size,omitempty"` - Tier *SkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/mixedreality/2025-01-01/proxy/predicates.go b/resource-manager/mixedreality/2025-01-01/proxy/predicates.go deleted file mode 100644 index 991fea90eda..00000000000 --- a/resource-manager/mixedreality/2025-01-01/proxy/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package proxy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p RemoteRenderingAccountOperationPredicate) Matches(input RemoteRenderingAccount) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/resource-manager/mixedreality/2025-01-01/proxy/version.go b/resource-manager/mixedreality/2025-01-01/proxy/version.go deleted file mode 100644 index ac203c9eca3..00000000000 --- a/resource-manager/mixedreality/2025-01-01/proxy/version.go +++ /dev/null @@ -1,10 +0,0 @@ -package proxy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2025-01-01" - -func userAgent() string { - return "hashicorp/go-azure-sdk/proxy/2025-01-01" -} diff --git a/resource-manager/mixedreality/2025-01-01/resource/README.md b/resource-manager/mixedreality/2025-01-01/resource/README.md deleted file mode 100644 index e92eb2becac..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/README.md +++ /dev/null @@ -1,129 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2025-01-01/resource` Documentation - -The `resource` SDK allows for interaction with Azure Resource Manager `mixedreality` (API Version `2025-01-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2025-01-01/resource" -``` - - -### Client Initialization - -```go -client := resource.NewResourceClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ResourceClient.RemoteRenderingAccountsCreate` - -```go -ctx := context.TODO() -id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - -payload := resource.RemoteRenderingAccount{ - // ... -} - - -read, err := client.RemoteRenderingAccountsCreate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ResourceClient.RemoteRenderingAccountsDelete` - -```go -ctx := context.TODO() -id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - -read, err := client.RemoteRenderingAccountsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ResourceClient.RemoteRenderingAccountsGet` - -```go -ctx := context.TODO() -id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - -read, err := client.RemoteRenderingAccountsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ResourceClient.RemoteRenderingAccountsListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.RemoteRenderingAccountsListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.RemoteRenderingAccountsListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ResourceClient.RemoteRenderingAccountsListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.RemoteRenderingAccountsListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.RemoteRenderingAccountsListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ResourceClient.RemoteRenderingAccountsUpdate` - -```go -ctx := context.TODO() -id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - -payload := resource.RemoteRenderingAccount{ - // ... -} - - -read, err := client.RemoteRenderingAccountsUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/resource-manager/mixedreality/2025-01-01/resource/client.go b/resource-manager/mixedreality/2025-01-01/resource/client.go deleted file mode 100644 index 672e189b06e..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package resource - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceClient struct { - Client *resourcemanager.Client -} - -func NewResourceClientWithBaseURI(sdkApi sdkEnv.Api) (*ResourceClient, error) { - client, err := resourcemanager.NewClient(sdkApi, "resource", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ResourceClient: %+v", err) - } - - return &ResourceClient{ - Client: client, - }, nil -} diff --git a/resource-manager/mixedreality/2025-01-01/resource/constants.go b/resource-manager/mixedreality/2025-01-01/resource/constants.go deleted file mode 100644 index 43e22f34c40..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package resource - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SkuTier string - -const ( - SkuTierBasic SkuTier = "Basic" - SkuTierFree SkuTier = "Free" - SkuTierPremium SkuTier = "Premium" - SkuTierStandard SkuTier = "Standard" -) - -func PossibleValuesForSkuTier() []string { - return []string{ - string(SkuTierBasic), - string(SkuTierFree), - string(SkuTierPremium), - string(SkuTierStandard), - } -} - -func (s *SkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSkuTier(input string) (*SkuTier, error) { - vals := map[string]SkuTier{ - "basic": SkuTierBasic, - "free": SkuTierFree, - "premium": SkuTierPremium, - "standard": SkuTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SkuTier(input) - return &out, nil -} diff --git a/resource-manager/mixedreality/2025-01-01/resource/id_remoterenderingaccount.go b/resource-manager/mixedreality/2025-01-01/resource/id_remoterenderingaccount.go deleted file mode 100644 index 7573ded1718..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/id_remoterenderingaccount.go +++ /dev/null @@ -1,130 +0,0 @@ -package resource - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&RemoteRenderingAccountId{}) -} - -var _ resourceids.ResourceId = &RemoteRenderingAccountId{} - -// RemoteRenderingAccountId is a struct representing the Resource ID for a Remote Rendering Account -type RemoteRenderingAccountId struct { - SubscriptionId string - ResourceGroupName string - RemoteRenderingAccountName string -} - -// NewRemoteRenderingAccountID returns a new RemoteRenderingAccountId struct -func NewRemoteRenderingAccountID(subscriptionId string, resourceGroupName string, remoteRenderingAccountName string) RemoteRenderingAccountId { - return RemoteRenderingAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RemoteRenderingAccountName: remoteRenderingAccountName, - } -} - -// ParseRemoteRenderingAccountID parses 'input' into a RemoteRenderingAccountId -func ParseRemoteRenderingAccountID(input string) (*RemoteRenderingAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(&RemoteRenderingAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RemoteRenderingAccountId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRemoteRenderingAccountIDInsensitively parses 'input' case-insensitively into a RemoteRenderingAccountId -// note: this method should only be used for API response data and not user input -func ParseRemoteRenderingAccountIDInsensitively(input string) (*RemoteRenderingAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(&RemoteRenderingAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RemoteRenderingAccountId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RemoteRenderingAccountId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.RemoteRenderingAccountName, ok = input.Parsed["remoteRenderingAccountName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "remoteRenderingAccountName", input) - } - - return nil -} - -// ValidateRemoteRenderingAccountID checks that 'input' can be parsed as a Remote Rendering Account ID -func ValidateRemoteRenderingAccountID(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 := ParseRemoteRenderingAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Remote Rendering Account ID -func (id RemoteRenderingAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.MixedReality/remoteRenderingAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RemoteRenderingAccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Remote Rendering Account ID -func (id RemoteRenderingAccountId) 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("staticMicrosoftMixedReality", "Microsoft.MixedReality", "Microsoft.MixedReality"), - resourceids.StaticSegment("staticRemoteRenderingAccounts", "remoteRenderingAccounts", "remoteRenderingAccounts"), - resourceids.UserSpecifiedSegment("remoteRenderingAccountName", "remoteRenderingAccountName"), - } -} - -// String returns a human-readable description of this Remote Rendering Account ID -func (id RemoteRenderingAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Remote Rendering Account Name: %q", id.RemoteRenderingAccountName), - } - return fmt.Sprintf("Remote Rendering Account (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/mixedreality/2025-01-01/resource/id_remoterenderingaccount_test.go b/resource-manager/mixedreality/2025-01-01/resource/id_remoterenderingaccount_test.go deleted file mode 100644 index dde33490d8e..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/id_remoterenderingaccount_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package resource - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ resourceids.ResourceId = &RemoteRenderingAccountId{} - -func TestNewRemoteRenderingAccountID(t *testing.T) { - id := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") - - if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") - } - - if id.ResourceGroupName != "example-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") - } - - if id.RemoteRenderingAccountName != "remoteRenderingAccountName" { - t.Fatalf("Expected %q but got %q for Segment 'RemoteRenderingAccountName'", id.RemoteRenderingAccountName, "remoteRenderingAccountName") - } -} - -func TestFormatRemoteRenderingAccountID(t *testing.T) { - actual := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRemoteRenderingAccountID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RemoteRenderingAccountId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName", - Expected: &RemoteRenderingAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RemoteRenderingAccountName: "remoteRenderingAccountName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRemoteRenderingAccountID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.ResourceGroupName != v.Expected.ResourceGroupName { - t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) - } - - if actual.RemoteRenderingAccountName != v.Expected.RemoteRenderingAccountName { - t.Fatalf("Expected %q but got %q for RemoteRenderingAccountName", v.Expected.RemoteRenderingAccountName, actual.RemoteRenderingAccountName) - } - - } -} - -func TestParseRemoteRenderingAccountIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RemoteRenderingAccountId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName", - Expected: &RemoteRenderingAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RemoteRenderingAccountName: "remoteRenderingAccountName", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/rEmOtErEnDeRiNgAcCoUnTnAmE", - Expected: &RemoteRenderingAccountId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RemoteRenderingAccountName: "rEmOtErEnDeRiNgAcCoUnTnAmE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/rEmOtErEnDeRiNgAcCoUnTnAmE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRemoteRenderingAccountIDInsensitively(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %+v", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - - if actual.ResourceGroupName != v.Expected.ResourceGroupName { - t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) - } - - if actual.RemoteRenderingAccountName != v.Expected.RemoteRenderingAccountName { - t.Fatalf("Expected %q but got %q for RemoteRenderingAccountName", v.Expected.RemoteRenderingAccountName, actual.RemoteRenderingAccountName) - } - - } -} - -func TestSegmentsForRemoteRenderingAccountId(t *testing.T) { - segments := RemoteRenderingAccountId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RemoteRenderingAccountId has no segments") - } - - uniqueNames := make(map[string]struct{}, 0) - for _, segment := range segments { - uniqueNames[segment.Name] = struct{}{} - } - if len(uniqueNames) != len(segments) { - t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) - } -} diff --git a/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountscreate.go b/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountscreate.go deleted file mode 100644 index 570a9c1a924..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountscreate.go +++ /dev/null @@ -1,58 +0,0 @@ -package resource - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsCreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RemoteRenderingAccount -} - -// RemoteRenderingAccountsCreate ... -func (c ResourceClient) RemoteRenderingAccountsCreate(ctx context.Context, id RemoteRenderingAccountId, input RemoteRenderingAccount) (result RemoteRenderingAccountsCreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model RemoteRenderingAccount - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountsdelete.go b/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountsdelete.go deleted file mode 100644 index d92a1ed8507..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountsdelete.go +++ /dev/null @@ -1,47 +0,0 @@ -package resource - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsDeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// RemoteRenderingAccountsDelete ... -func (c ResourceClient) RemoteRenderingAccountsDelete(ctx context.Context, id RemoteRenderingAccountId) (result RemoteRenderingAccountsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountsget.go b/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountsget.go deleted file mode 100644 index d60c553dd77..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountsget.go +++ /dev/null @@ -1,53 +0,0 @@ -package resource - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RemoteRenderingAccount -} - -// RemoteRenderingAccountsGet ... -func (c ResourceClient) RemoteRenderingAccountsGet(ctx context.Context, id RemoteRenderingAccountId) (result RemoteRenderingAccountsGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model RemoteRenderingAccount - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountslistbyresourcegroup.go b/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountslistbyresourcegroup.go deleted file mode 100644 index 3a0baec90fa..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountslistbyresourcegroup.go +++ /dev/null @@ -1,106 +0,0 @@ -package resource - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RemoteRenderingAccount -} - -type RemoteRenderingAccountsListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []RemoteRenderingAccount -} - -type RemoteRenderingAccountsListByResourceGroupCustomPager struct { - NextLink *odata.Link `json:"nextLink"` -} - -func (p *RemoteRenderingAccountsListByResourceGroupCustomPager) NextPageLink() *odata.Link { - defer func() { - p.NextLink = nil - }() - - return p.NextLink -} - -// RemoteRenderingAccountsListByResourceGroup ... -func (c ResourceClient) RemoteRenderingAccountsListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result RemoteRenderingAccountsListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Pager: &RemoteRenderingAccountsListByResourceGroupCustomPager{}, - Path: fmt.Sprintf("%s/providers/Microsoft.MixedReality/remoteRenderingAccounts", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]RemoteRenderingAccount `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// RemoteRenderingAccountsListByResourceGroupComplete retrieves all the results into a single object -func (c ResourceClient) RemoteRenderingAccountsListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (RemoteRenderingAccountsListByResourceGroupCompleteResult, error) { - return c.RemoteRenderingAccountsListByResourceGroupCompleteMatchingPredicate(ctx, id, RemoteRenderingAccountOperationPredicate{}) -} - -// RemoteRenderingAccountsListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ResourceClient) RemoteRenderingAccountsListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate RemoteRenderingAccountOperationPredicate) (result RemoteRenderingAccountsListByResourceGroupCompleteResult, err error) { - items := make([]RemoteRenderingAccount, 0) - - resp, err := c.RemoteRenderingAccountsListByResourceGroup(ctx, id) - if err != nil { - result.LatestHttpResponse = resp.HttpResponse - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = RemoteRenderingAccountsListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountslistbysubscription.go b/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountslistbysubscription.go deleted file mode 100644 index 05a16e1bcc4..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountslistbysubscription.go +++ /dev/null @@ -1,106 +0,0 @@ -package resource - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RemoteRenderingAccount -} - -type RemoteRenderingAccountsListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []RemoteRenderingAccount -} - -type RemoteRenderingAccountsListBySubscriptionCustomPager struct { - NextLink *odata.Link `json:"nextLink"` -} - -func (p *RemoteRenderingAccountsListBySubscriptionCustomPager) NextPageLink() *odata.Link { - defer func() { - p.NextLink = nil - }() - - return p.NextLink -} - -// RemoteRenderingAccountsListBySubscription ... -func (c ResourceClient) RemoteRenderingAccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result RemoteRenderingAccountsListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Pager: &RemoteRenderingAccountsListBySubscriptionCustomPager{}, - Path: fmt.Sprintf("%s/providers/Microsoft.MixedReality/remoteRenderingAccounts", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]RemoteRenderingAccount `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// RemoteRenderingAccountsListBySubscriptionComplete retrieves all the results into a single object -func (c ResourceClient) RemoteRenderingAccountsListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (RemoteRenderingAccountsListBySubscriptionCompleteResult, error) { - return c.RemoteRenderingAccountsListBySubscriptionCompleteMatchingPredicate(ctx, id, RemoteRenderingAccountOperationPredicate{}) -} - -// RemoteRenderingAccountsListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ResourceClient) RemoteRenderingAccountsListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate RemoteRenderingAccountOperationPredicate) (result RemoteRenderingAccountsListBySubscriptionCompleteResult, err error) { - items := make([]RemoteRenderingAccount, 0) - - resp, err := c.RemoteRenderingAccountsListBySubscription(ctx, id) - if err != nil { - result.LatestHttpResponse = resp.HttpResponse - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = RemoteRenderingAccountsListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountsupdate.go b/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountsupdate.go deleted file mode 100644 index a690cc24266..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/method_remoterenderingaccountsupdate.go +++ /dev/null @@ -1,57 +0,0 @@ -package resource - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountsUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RemoteRenderingAccount -} - -// RemoteRenderingAccountsUpdate ... -func (c ResourceClient) RemoteRenderingAccountsUpdate(ctx context.Context, id RemoteRenderingAccountId, input RemoteRenderingAccount) (result RemoteRenderingAccountsUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var model RemoteRenderingAccount - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/mixedreality/2025-01-01/resource/model_mixedrealityaccountproperties.go b/resource-manager/mixedreality/2025-01-01/resource/model_mixedrealityaccountproperties.go deleted file mode 100644 index 38d0a1ed639..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/model_mixedrealityaccountproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package resource - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MixedRealityAccountProperties struct { - AccountDomain *string `json:"accountDomain,omitempty"` - AccountId *string `json:"accountId,omitempty"` - StorageAccountName *string `json:"storageAccountName,omitempty"` -} diff --git a/resource-manager/mixedreality/2025-01-01/resource/model_remoterenderingaccount.go b/resource-manager/mixedreality/2025-01-01/resource/model_remoterenderingaccount.go deleted file mode 100644 index 976e458637d..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/model_remoterenderingaccount.go +++ /dev/null @@ -1,23 +0,0 @@ -package resource - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccount struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemAssigned `json:"identity,omitempty"` - Kind *Sku `json:"kind,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Plan *identity.SystemAssigned `json:"plan,omitempty"` - Properties *MixedRealityAccountProperties `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/resource-manager/mixedreality/2025-01-01/resource/model_sku.go b/resource-manager/mixedreality/2025-01-01/resource/model_sku.go deleted file mode 100644 index 182c316eff9..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/model_sku.go +++ /dev/null @@ -1,12 +0,0 @@ -package resource - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Sku struct { - Capacity *int64 `json:"capacity,omitempty"` - Family *string `json:"family,omitempty"` - Name string `json:"name"` - Size *string `json:"size,omitempty"` - Tier *SkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/mixedreality/2025-01-01/resource/predicates.go b/resource-manager/mixedreality/2025-01-01/resource/predicates.go deleted file mode 100644 index a2d799f7e32..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package resource - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RemoteRenderingAccountOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p RemoteRenderingAccountOperationPredicate) Matches(input RemoteRenderingAccount) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/resource-manager/mixedreality/2025-01-01/resource/version.go b/resource-manager/mixedreality/2025-01-01/resource/version.go deleted file mode 100644 index ca3a07c877c..00000000000 --- a/resource-manager/mixedreality/2025-01-01/resource/version.go +++ /dev/null @@ -1,10 +0,0 @@ -package resource - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2025-01-01" - -func userAgent() string { - return "hashicorp/go-azure-sdk/resource/2025-01-01" -} diff --git a/resource-manager/network/2024-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go b/resource-manager/network/2024-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go index 9007e4a33df..caa8b3c8747 100644 --- a/resource-manager/network/2024-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go +++ b/resource-manager/network/2024-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go @@ -217,8 +217,6 @@ func parseIsGlobal(input string) (*IsGlobal, error) { type ProvisioningState string const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -227,8 +225,6 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -251,8 +247,6 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/network/2024-05-01/networkmanagereffectivesecurityadminrules/constants.go b/resource-manager/network/2024-05-01/networkmanagereffectivesecurityadminrules/constants.go index 6dbd1e6db74..67086d778e3 100644 --- a/resource-manager/network/2024-05-01/networkmanagereffectivesecurityadminrules/constants.go +++ b/resource-manager/network/2024-05-01/networkmanagereffectivesecurityadminrules/constants.go @@ -138,8 +138,6 @@ func parseGroupMemberType(input string) (*GroupMemberType, error) { type ProvisioningState string const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -148,8 +146,6 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -172,8 +168,6 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/network/2024-07-01/networkmanagereffectiveconnectivityconfiguration/constants.go b/resource-manager/network/2024-07-01/networkmanagereffectiveconnectivityconfiguration/constants.go index c5bc0377dcd..aa292723727 100644 --- a/resource-manager/network/2024-07-01/networkmanagereffectiveconnectivityconfiguration/constants.go +++ b/resource-manager/network/2024-07-01/networkmanagereffectiveconnectivityconfiguration/constants.go @@ -340,8 +340,6 @@ func parsePeeringEnforcement(input string) (*PeeringEnforcement, error) { type ProvisioningState string const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -350,8 +348,6 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -374,8 +370,6 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/network/2024-07-01/networkmanagereffectivesecurityadminrules/constants.go b/resource-manager/network/2024-07-01/networkmanagereffectivesecurityadminrules/constants.go index 6dbd1e6db74..67086d778e3 100644 --- a/resource-manager/network/2024-07-01/networkmanagereffectivesecurityadminrules/constants.go +++ b/resource-manager/network/2024-07-01/networkmanagereffectivesecurityadminrules/constants.go @@ -138,8 +138,6 @@ func parseGroupMemberType(input string) (*GroupMemberType, error) { type ProvisioningState string const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -148,8 +146,6 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -172,8 +168,6 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/network/2024-10-01/networkmanagereffectiveconnectivityconfiguration/constants.go b/resource-manager/network/2024-10-01/networkmanagereffectiveconnectivityconfiguration/constants.go index aa292723727..c5bc0377dcd 100644 --- a/resource-manager/network/2024-10-01/networkmanagereffectiveconnectivityconfiguration/constants.go +++ b/resource-manager/network/2024-10-01/networkmanagereffectiveconnectivityconfiguration/constants.go @@ -340,6 +340,8 @@ func parsePeeringEnforcement(input string) (*PeeringEnforcement, error) { type ProvisioningState string const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -348,6 +350,8 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -370,6 +374,8 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/network/2024-10-01/networkmanagereffectivesecurityadminrules/constants.go b/resource-manager/network/2024-10-01/networkmanagereffectivesecurityadminrules/constants.go index 67086d778e3..6dbd1e6db74 100644 --- a/resource-manager/network/2024-10-01/networkmanagereffectivesecurityadminrules/constants.go +++ b/resource-manager/network/2024-10-01/networkmanagereffectivesecurityadminrules/constants.go @@ -138,6 +138,8 @@ func parseGroupMemberType(input string) (*GroupMemberType, error) { type ProvisioningState string const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -146,6 +148,8 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -168,6 +172,8 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/network/2025-01-01/networkmanageractiveconfigurations/constants.go b/resource-manager/network/2025-01-01/networkmanageractiveconfigurations/constants.go index c9291fb2fab..793caeabedc 100644 --- a/resource-manager/network/2025-01-01/networkmanageractiveconfigurations/constants.go +++ b/resource-manager/network/2025-01-01/networkmanageractiveconfigurations/constants.go @@ -138,6 +138,8 @@ func parseGroupMemberType(input string) (*GroupMemberType, error) { type ProvisioningState string const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -146,6 +148,8 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -168,6 +172,8 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/network/2025-01-01/networkmanageractiveconnectivityconfigurations/constants.go b/resource-manager/network/2025-01-01/networkmanageractiveconnectivityconfigurations/constants.go index 8195863c49a..451770f8cbb 100644 --- a/resource-manager/network/2025-01-01/networkmanageractiveconnectivityconfigurations/constants.go +++ b/resource-manager/network/2025-01-01/networkmanageractiveconnectivityconfigurations/constants.go @@ -340,6 +340,8 @@ func parsePeeringEnforcement(input string) (*PeeringEnforcement, error) { type ProvisioningState string const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -348,6 +350,8 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -370,6 +374,8 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/network/2025-01-01/networkmanagereffectiveconnectivityconfiguration/constants.go b/resource-manager/network/2025-01-01/networkmanagereffectiveconnectivityconfiguration/constants.go index c5bc0377dcd..aa292723727 100644 --- a/resource-manager/network/2025-01-01/networkmanagereffectiveconnectivityconfiguration/constants.go +++ b/resource-manager/network/2025-01-01/networkmanagereffectiveconnectivityconfiguration/constants.go @@ -340,8 +340,6 @@ func parsePeeringEnforcement(input string) (*PeeringEnforcement, error) { type ProvisioningState string const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -350,8 +348,6 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -374,8 +370,6 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/network/2025-01-01/networkmanagereffectivesecurityadminrules/constants.go b/resource-manager/network/2025-01-01/networkmanagereffectivesecurityadminrules/constants.go index 6dbd1e6db74..67086d778e3 100644 --- a/resource-manager/network/2025-01-01/networkmanagereffectivesecurityadminrules/constants.go +++ b/resource-manager/network/2025-01-01/networkmanagereffectivesecurityadminrules/constants.go @@ -138,8 +138,6 @@ func parseGroupMemberType(input string) (*GroupMemberType, error) { type ProvisioningState string const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -148,8 +146,6 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -172,8 +168,6 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/recoveryservicesbackup/2025-02-01/protecteditems/model_erroradditionalinfo.go b/resource-manager/recoveryservicesbackup/2025-02-01/protecteditems/model_erroradditionalinfo.go deleted file mode 100644 index 8e707921e70..00000000000 --- a/resource-manager/recoveryservicesbackup/2025-02-01/protecteditems/model_erroradditionalinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package protecteditems - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ErrorAdditionalInfo struct { - Info *interface{} `json:"info,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2025-02-01/protecteditems/model_errordetail.go b/resource-manager/recoveryservicesbackup/2025-02-01/protecteditems/model_errordetail.go index cbf15d6fb2c..e3fa04c50a3 100644 --- a/resource-manager/recoveryservicesbackup/2025-02-01/protecteditems/model_errordetail.go +++ b/resource-manager/recoveryservicesbackup/2025-02-01/protecteditems/model_errordetail.go @@ -4,9 +4,7 @@ package protecteditems // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ErrorDetail struct { - AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` - Code *string `json:"code,omitempty"` - Details *[]ErrorDetail `json:"details,omitempty"` - Message *string `json:"message,omitempty"` - Target *string `json:"target,omitempty"` + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Recommendations *[]string `json:"recommendations,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2025-02-01/protectioncontainers/model_erroradditionalinfo.go b/resource-manager/recoveryservicesbackup/2025-02-01/protectioncontainers/model_erroradditionalinfo.go deleted file mode 100644 index 8e24f9a7b12..00000000000 --- a/resource-manager/recoveryservicesbackup/2025-02-01/protectioncontainers/model_erroradditionalinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package protectioncontainers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ErrorAdditionalInfo struct { - Info *interface{} `json:"info,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2025-02-01/protectioncontainers/model_errordetail.go b/resource-manager/recoveryservicesbackup/2025-02-01/protectioncontainers/model_errordetail.go index 44feb059e5d..6eac856c404 100644 --- a/resource-manager/recoveryservicesbackup/2025-02-01/protectioncontainers/model_errordetail.go +++ b/resource-manager/recoveryservicesbackup/2025-02-01/protectioncontainers/model_errordetail.go @@ -4,9 +4,7 @@ package protectioncontainers // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ErrorDetail struct { - AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` - Code *string `json:"code,omitempty"` - Details *[]ErrorDetail `json:"details,omitempty"` - Message *string `json:"message,omitempty"` - Target *string `json:"target,omitempty"` + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Recommendations *[]string `json:"recommendations,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2025-02-01/softdeletedcontainers/model_erroradditionalinfo.go b/resource-manager/recoveryservicesbackup/2025-02-01/softdeletedcontainers/model_erroradditionalinfo.go deleted file mode 100644 index 30f15bc8fa3..00000000000 --- a/resource-manager/recoveryservicesbackup/2025-02-01/softdeletedcontainers/model_erroradditionalinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package softdeletedcontainers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ErrorAdditionalInfo struct { - Info *interface{} `json:"info,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2025-02-01/softdeletedcontainers/model_errordetail.go b/resource-manager/recoveryservicesbackup/2025-02-01/softdeletedcontainers/model_errordetail.go index 017103a66c3..b76617c0e57 100644 --- a/resource-manager/recoveryservicesbackup/2025-02-01/softdeletedcontainers/model_errordetail.go +++ b/resource-manager/recoveryservicesbackup/2025-02-01/softdeletedcontainers/model_errordetail.go @@ -4,9 +4,7 @@ package softdeletedcontainers // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ErrorDetail struct { - AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` - Code *string `json:"code,omitempty"` - Details *[]ErrorDetail `json:"details,omitempty"` - Message *string `json:"message,omitempty"` - Target *string `json:"target,omitempty"` + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Recommendations *[]string `json:"recommendations,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2025-08-01/operation/model_erroradditionalinfo.go b/resource-manager/recoveryservicesbackup/2025-08-01/operation/model_erroradditionalinfo.go deleted file mode 100644 index 9ab2947bdeb..00000000000 --- a/resource-manager/recoveryservicesbackup/2025-08-01/operation/model_erroradditionalinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package operation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ErrorAdditionalInfo struct { - Info *interface{} `json:"info,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2025-08-01/operation/model_errordetail.go b/resource-manager/recoveryservicesbackup/2025-08-01/operation/model_errordetail.go index aed79a5ae3b..2c609c87024 100644 --- a/resource-manager/recoveryservicesbackup/2025-08-01/operation/model_errordetail.go +++ b/resource-manager/recoveryservicesbackup/2025-08-01/operation/model_errordetail.go @@ -4,9 +4,7 @@ package operation // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ErrorDetail struct { - AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` - Code *string `json:"code,omitempty"` - Details *[]ErrorDetail `json:"details,omitempty"` - Message *string `json:"message,omitempty"` - Target *string `json:"target,omitempty"` + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Recommendations *[]string `json:"recommendations,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2025-08-01/protecteditems/model_erroradditionalinfo.go b/resource-manager/recoveryservicesbackup/2025-08-01/protecteditems/model_erroradditionalinfo.go deleted file mode 100644 index 8e707921e70..00000000000 --- a/resource-manager/recoveryservicesbackup/2025-08-01/protecteditems/model_erroradditionalinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package protecteditems - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ErrorAdditionalInfo struct { - Info *interface{} `json:"info,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2025-08-01/protecteditems/model_errordetail.go b/resource-manager/recoveryservicesbackup/2025-08-01/protecteditems/model_errordetail.go index cbf15d6fb2c..e3fa04c50a3 100644 --- a/resource-manager/recoveryservicesbackup/2025-08-01/protecteditems/model_errordetail.go +++ b/resource-manager/recoveryservicesbackup/2025-08-01/protecteditems/model_errordetail.go @@ -4,9 +4,7 @@ package protecteditems // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ErrorDetail struct { - AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` - Code *string `json:"code,omitempty"` - Details *[]ErrorDetail `json:"details,omitempty"` - Message *string `json:"message,omitempty"` - Target *string `json:"target,omitempty"` + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Recommendations *[]string `json:"recommendations,omitempty"` }