diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/CHANGELOG.md b/sdk/resourcemanager/databoxedge/armdataboxedge/CHANGELOG.md index 4063b9cfe0f5..cd5c379d1ee4 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/CHANGELOG.md +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 2.0.0 (2023-02-13) +### Breaking Changes + +- Struct `CloudError` has been removed +- Struct `CloudErrorBody` has been removed + + ## 1.0.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_addons_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/addons_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_addons_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/addons_client.go index beb01a5dee19..8e589f7ba876 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_addons_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/addons_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type AddonsClient struct { } // NewAddonsClient creates a new instance of AddonsClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAddonsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AddonsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewAddonsClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Create or update a addon. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// roleName - The role name. -// addonName - The addon name. -// resourceGroupName - The resource group name. -// addon - The addon properties. -// options - AddonsClientBeginCreateOrUpdateOptions contains the optional parameters for the AddonsClient.BeginCreateOrUpdate -// method. +// - deviceName - The device name. +// - roleName - The role name. +// - addonName - The addon name. +// - resourceGroupName - The resource group name. +// - addon - The addon properties. +// - options - AddonsClientBeginCreateOrUpdateOptions contains the optional parameters for the AddonsClient.BeginCreateOrUpdate +// method. func (client *AddonsClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, roleName string, addonName string, resourceGroupName string, addon AddonClassification, options *AddonsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AddonsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, deviceName, roleName, addonName, resourceGroupName, addon, options) @@ -78,6 +80,7 @@ func (client *AddonsClient) BeginCreateOrUpdate(ctx context.Context, deviceName // CreateOrUpdate - Create or update a addon. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *AddonsClient) createOrUpdate(ctx context.Context, deviceName string, roleName string, addonName string, resourceGroupName string, addon AddonClassification, options *AddonsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, deviceName, roleName, addonName, resourceGroupName, addon, options) @@ -130,12 +133,13 @@ func (client *AddonsClient) createOrUpdateCreateRequest(ctx context.Context, dev // BeginDelete - Deletes the addon on the device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// roleName - The role name. -// addonName - The addon name. -// resourceGroupName - The resource group name. -// options - AddonsClientBeginDeleteOptions contains the optional parameters for the AddonsClient.BeginDelete method. +// - deviceName - The device name. +// - roleName - The role name. +// - addonName - The addon name. +// - resourceGroupName - The resource group name. +// - options - AddonsClientBeginDeleteOptions contains the optional parameters for the AddonsClient.BeginDelete method. func (client *AddonsClient) BeginDelete(ctx context.Context, deviceName string, roleName string, addonName string, resourceGroupName string, options *AddonsClientBeginDeleteOptions) (*runtime.Poller[AddonsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, deviceName, roleName, addonName, resourceGroupName, options) @@ -150,6 +154,7 @@ func (client *AddonsClient) BeginDelete(ctx context.Context, deviceName string, // Delete - Deletes the addon on the device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *AddonsClient) deleteOperation(ctx context.Context, deviceName string, roleName string, addonName string, resourceGroupName string, options *AddonsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, deviceName, roleName, addonName, resourceGroupName, options) @@ -202,12 +207,13 @@ func (client *AddonsClient) deleteCreateRequest(ctx context.Context, deviceName // Get - Gets a specific addon by name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// roleName - The role name. -// addonName - The addon name. -// resourceGroupName - The resource group name. -// options - AddonsClientGetOptions contains the optional parameters for the AddonsClient.Get method. +// - deviceName - The device name. +// - roleName - The role name. +// - addonName - The addon name. +// - resourceGroupName - The resource group name. +// - options - AddonsClientGetOptions contains the optional parameters for the AddonsClient.Get method. func (client *AddonsClient) Get(ctx context.Context, deviceName string, roleName string, addonName string, resourceGroupName string, options *AddonsClientGetOptions) (AddonsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, roleName, addonName, resourceGroupName, options) if err != nil { @@ -267,12 +273,12 @@ func (client *AddonsClient) getHandleResponse(resp *http.Response) (AddonsClient } // NewListByRolePager - Lists all the addons configured in the role. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// roleName - The role name. -// resourceGroupName - The resource group name. -// options - AddonsClientListByRoleOptions contains the optional parameters for the AddonsClient.ListByRole method. +// - deviceName - The device name. +// - roleName - The role name. +// - resourceGroupName - The resource group name. +// - options - AddonsClientListByRoleOptions contains the optional parameters for the AddonsClient.NewListByRolePager method. func (client *AddonsClient) NewListByRolePager(deviceName string, roleName string, resourceGroupName string, options *AddonsClientListByRoleOptions) *runtime.Pager[AddonsClientListByRoleResponse] { return runtime.NewPager(runtime.PagingHandler[AddonsClientListByRoleResponse]{ More: func(page AddonsClientListByRoleResponse) bool { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_alerts_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/alerts_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_alerts_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/alerts_client.go index e8b10fe21d90..c3a1ee32057c 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_alerts_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/alerts_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type AlertsClient struct { } // NewAlertsClient creates a new instance of AlertsClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAlertsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AlertsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,12 @@ func NewAlertsClient(subscriptionID string, credential azcore.TokenCredential, o // Get - Gets an alert by name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The alert name. -// resourceGroupName - The resource group name. -// options - AlertsClientGetOptions contains the optional parameters for the AlertsClient.Get method. +// - deviceName - The device name. +// - name - The alert name. +// - resourceGroupName - The resource group name. +// - options - AlertsClientGetOptions contains the optional parameters for the AlertsClient.Get method. func (client *AlertsClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string, options *AlertsClientGetOptions) (AlertsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, name, resourceGroupName, options) if err != nil { @@ -116,12 +118,12 @@ func (client *AlertsClient) getHandleResponse(resp *http.Response) (AlertsClient } // NewListByDataBoxEdgeDevicePager - Gets all the alerts for a Data Box Edge/Data Box Gateway device. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - AlertsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the AlertsClient.ListByDataBoxEdgeDevice -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - AlertsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the AlertsClient.NewListByDataBoxEdgeDevicePager +// method. func (client *AlertsClient) NewListByDataBoxEdgeDevicePager(deviceName string, resourceGroupName string, options *AlertsClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[AlertsClientListByDataBoxEdgeDeviceResponse] { return runtime.NewPager(runtime.PagingHandler[AlertsClientListByDataBoxEdgeDeviceResponse]{ More: func(page AlertsClientListByDataBoxEdgeDeviceResponse) bool { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/autorest.md b/sdk/resourcemanager/databoxedge/armdataboxedge/autorest.md index af3974d2462f..8c5f748cdae2 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/autorest.md +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/databoxedge/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/databoxedge/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/databoxedge/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/databoxedge/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_availableskus_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/availableskus_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_availableskus_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/availableskus_client.go index 8aba0db0c34e..9053c2327c9c 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_availableskus_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/availableskus_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type AvailableSKUsClient struct { } // NewAvailableSKUsClient creates a new instance of AvailableSKUsClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAvailableSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableSKUsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,9 +56,9 @@ func NewAvailableSKUsClient(subscriptionID string, credential azcore.TokenCreden } // NewListPager - List all the available Skus and information related to them. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// options - AvailableSKUsClientListOptions contains the optional parameters for the AvailableSKUsClient.List method. +// - options - AvailableSKUsClientListOptions contains the optional parameters for the AvailableSKUsClient.NewListPager method. func (client *AvailableSKUsClient) NewListPager(options *AvailableSKUsClientListOptions) *runtime.Pager[AvailableSKUsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AvailableSKUsClientListResponse]{ More: func(page AvailableSKUsClientListResponse) bool { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_bandwidthschedules_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/bandwidthschedules_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_bandwidthschedules_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/bandwidthschedules_client.go index a9a2c5548ea1..c89ea107da26 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_bandwidthschedules_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/bandwidthschedules_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type BandwidthSchedulesClient struct { } // NewBandwidthSchedulesClient creates a new instance of BandwidthSchedulesClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBandwidthSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BandwidthSchedulesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewBandwidthSchedulesClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Creates or updates a bandwidth schedule. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The bandwidth schedule name which needs to be added/updated. -// resourceGroupName - The resource group name. -// parameters - The bandwidth schedule to be added or updated. -// options - BandwidthSchedulesClientBeginCreateOrUpdateOptions contains the optional parameters for the BandwidthSchedulesClient.BeginCreateOrUpdate -// method. +// - deviceName - The device name. +// - name - The bandwidth schedule name which needs to be added/updated. +// - resourceGroupName - The resource group name. +// - parameters - The bandwidth schedule to be added or updated. +// - options - BandwidthSchedulesClientBeginCreateOrUpdateOptions contains the optional parameters for the BandwidthSchedulesClient.BeginCreateOrUpdate +// method. func (client *BandwidthSchedulesClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, parameters BandwidthSchedule, options *BandwidthSchedulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[BandwidthSchedulesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, parameters, options) @@ -77,6 +79,7 @@ func (client *BandwidthSchedulesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates a bandwidth schedule. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *BandwidthSchedulesClient) createOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, parameters BandwidthSchedule, options *BandwidthSchedulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, deviceName, name, resourceGroupName, parameters, options) @@ -125,12 +128,13 @@ func (client *BandwidthSchedulesClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Deletes the specified bandwidth schedule. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The bandwidth schedule name. -// resourceGroupName - The resource group name. -// options - BandwidthSchedulesClientBeginDeleteOptions contains the optional parameters for the BandwidthSchedulesClient.BeginDelete -// method. +// - deviceName - The device name. +// - name - The bandwidth schedule name. +// - resourceGroupName - The resource group name. +// - options - BandwidthSchedulesClientBeginDeleteOptions contains the optional parameters for the BandwidthSchedulesClient.BeginDelete +// method. func (client *BandwidthSchedulesClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *BandwidthSchedulesClientBeginDeleteOptions) (*runtime.Poller[BandwidthSchedulesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) @@ -145,6 +149,7 @@ func (client *BandwidthSchedulesClient) BeginDelete(ctx context.Context, deviceN // Delete - Deletes the specified bandwidth schedule. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *BandwidthSchedulesClient) deleteOperation(ctx context.Context, deviceName string, name string, resourceGroupName string, options *BandwidthSchedulesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, deviceName, name, resourceGroupName, options) @@ -193,11 +198,12 @@ func (client *BandwidthSchedulesClient) deleteCreateRequest(ctx context.Context, // Get - Gets the properties of the specified bandwidth schedule. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The bandwidth schedule name. -// resourceGroupName - The resource group name. -// options - BandwidthSchedulesClientGetOptions contains the optional parameters for the BandwidthSchedulesClient.Get method. +// - deviceName - The device name. +// - name - The bandwidth schedule name. +// - resourceGroupName - The resource group name. +// - options - BandwidthSchedulesClientGetOptions contains the optional parameters for the BandwidthSchedulesClient.Get method. func (client *BandwidthSchedulesClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string, options *BandwidthSchedulesClientGetOptions) (BandwidthSchedulesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, name, resourceGroupName, options) if err != nil { @@ -253,12 +259,12 @@ func (client *BandwidthSchedulesClient) getHandleResponse(resp *http.Response) ( } // NewListByDataBoxEdgeDevicePager - Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - BandwidthSchedulesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the BandwidthSchedulesClient.ListByDataBoxEdgeDevice -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - BandwidthSchedulesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the BandwidthSchedulesClient.NewListByDataBoxEdgeDevicePager +// method. func (client *BandwidthSchedulesClient) NewListByDataBoxEdgeDevicePager(deviceName string, resourceGroupName string, options *BandwidthSchedulesClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse] { return runtime.NewPager(runtime.PagingHandler[BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse]{ More: func(page BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse) bool { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_constants.go b/sdk/resourcemanager/databoxedge/armdataboxedge/constants.go similarity index 99% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_constants.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/constants.go index c8a79a180315..8661433f66d2 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_constants.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/constants.go @@ -5,12 +5,13 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge const ( moduleName = "armdataboxedge" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0" ) // AccessLevel - Access level allowed for this remote application type diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_containers_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/containers_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_containers_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/containers_client.go index 3e4027607221..c4eed40d714c 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_containers_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/containers_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type ContainersClient struct { } // NewContainersClient creates a new instance of ContainersClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewContainersClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Creates a new container or updates an existing container on the device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// storageAccountName - The Storage Account Name -// containerName - The container name. -// resourceGroupName - The resource group name. -// containerParam - The container properties. -// options - ContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainersClient.BeginCreateOrUpdate -// method. +// - deviceName - The device name. +// - storageAccountName - The Storage Account Name +// - containerName - The container name. +// - resourceGroupName - The resource group name. +// - containerParam - The container properties. +// - options - ContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainersClient.BeginCreateOrUpdate +// method. func (client *ContainersClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, containerParam Container, options *ContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ContainersClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, deviceName, storageAccountName, containerName, resourceGroupName, containerParam, options) @@ -78,6 +80,7 @@ func (client *ContainersClient) BeginCreateOrUpdate(ctx context.Context, deviceN // CreateOrUpdate - Creates a new container or updates an existing container on the device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *ContainersClient) createOrUpdate(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, containerParam Container, options *ContainersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, deviceName, storageAccountName, containerName, resourceGroupName, containerParam, options) @@ -130,12 +133,13 @@ func (client *ContainersClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes the container on the Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// storageAccountName - The Storage Account Name -// containerName - The container name. -// resourceGroupName - The resource group name. -// options - ContainersClientBeginDeleteOptions contains the optional parameters for the ContainersClient.BeginDelete method. +// - deviceName - The device name. +// - storageAccountName - The Storage Account Name +// - containerName - The container name. +// - resourceGroupName - The resource group name. +// - options - ContainersClientBeginDeleteOptions contains the optional parameters for the ContainersClient.BeginDelete method. func (client *ContainersClient) BeginDelete(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, options *ContainersClientBeginDeleteOptions) (*runtime.Poller[ContainersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, deviceName, storageAccountName, containerName, resourceGroupName, options) @@ -150,6 +154,7 @@ func (client *ContainersClient) BeginDelete(ctx context.Context, deviceName stri // Delete - Deletes the container on the Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *ContainersClient) deleteOperation(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, options *ContainersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, deviceName, storageAccountName, containerName, resourceGroupName, options) @@ -202,12 +207,13 @@ func (client *ContainersClient) deleteCreateRequest(ctx context.Context, deviceN // Get - Gets a container by name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// storageAccountName - The Storage Account Name -// containerName - The container Name -// resourceGroupName - The resource group name. -// options - ContainersClientGetOptions contains the optional parameters for the ContainersClient.Get method. +// - deviceName - The device name. +// - storageAccountName - The Storage Account Name +// - containerName - The container Name +// - resourceGroupName - The resource group name. +// - options - ContainersClientGetOptions contains the optional parameters for the ContainersClient.Get method. func (client *ContainersClient) Get(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, options *ContainersClientGetOptions) (ContainersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, storageAccountName, containerName, resourceGroupName, options) if err != nil { @@ -267,13 +273,13 @@ func (client *ContainersClient) getHandleResponse(resp *http.Response) (Containe } // NewListByStorageAccountPager - Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// storageAccountName - The storage Account name. -// resourceGroupName - The resource group name. -// options - ContainersClientListByStorageAccountOptions contains the optional parameters for the ContainersClient.ListByStorageAccount -// method. +// - deviceName - The device name. +// - storageAccountName - The storage Account name. +// - resourceGroupName - The resource group name. +// - options - ContainersClientListByStorageAccountOptions contains the optional parameters for the ContainersClient.NewListByStorageAccountPager +// method. func (client *ContainersClient) NewListByStorageAccountPager(deviceName string, storageAccountName string, resourceGroupName string, options *ContainersClientListByStorageAccountOptions) *runtime.Pager[ContainersClientListByStorageAccountResponse] { return runtime.NewPager(runtime.PagingHandler[ContainersClientListByStorageAccountResponse]{ More: func(page ContainersClientListByStorageAccountResponse) bool { @@ -343,12 +349,13 @@ func (client *ContainersClient) listByStorageAccountHandleResponse(resp *http.Re // BeginRefresh - Refreshes the container metadata with the data from the cloud. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// storageAccountName - The Storage Account Name -// containerName - The container name. -// resourceGroupName - The resource group name. -// options - ContainersClientBeginRefreshOptions contains the optional parameters for the ContainersClient.BeginRefresh method. +// - deviceName - The device name. +// - storageAccountName - The Storage Account Name +// - containerName - The container name. +// - resourceGroupName - The resource group name. +// - options - ContainersClientBeginRefreshOptions contains the optional parameters for the ContainersClient.BeginRefresh method. func (client *ContainersClient) BeginRefresh(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, options *ContainersClientBeginRefreshOptions) (*runtime.Poller[ContainersClientRefreshResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.refresh(ctx, deviceName, storageAccountName, containerName, resourceGroupName, options) @@ -363,6 +370,7 @@ func (client *ContainersClient) BeginRefresh(ctx context.Context, deviceName str // Refresh - Refreshes the container metadata with the data from the cloud. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *ContainersClient) refresh(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, options *ContainersClientBeginRefreshOptions) (*http.Response, error) { req, err := client.refreshCreateRequest(ctx, deviceName, storageAccountName, containerName, resourceGroupName, options) diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devicecapacitycheck_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/devicecapacitycheck_client.go similarity index 90% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devicecapacitycheck_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/devicecapacitycheck_client.go index eb127ba60b5f..23e597912bac 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devicecapacitycheck_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/devicecapacitycheck_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type DeviceCapacityCheckClient struct { } // NewDeviceCapacityCheckClient creates a new instance of DeviceCapacityCheckClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDeviceCapacityCheckClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeviceCapacityCheckClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewDeviceCapacityCheckClient(subscriptionID string, credential azcore.Token // BeginCheckResourceCreationFeasibility - Posts the device capacity request info to check feasibility. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// resourceGroupName - The resource group name. -// deviceName - The device name. -// deviceCapacityRequestInfo - The device capacity request info. -// options - DeviceCapacityCheckClientBeginCheckResourceCreationFeasibilityOptions contains the optional parameters for the -// DeviceCapacityCheckClient.BeginCheckResourceCreationFeasibility method. +// - resourceGroupName - The resource group name. +// - deviceName - The device name. +// - deviceCapacityRequestInfo - The device capacity request info. +// - options - DeviceCapacityCheckClientBeginCheckResourceCreationFeasibilityOptions contains the optional parameters for the +// DeviceCapacityCheckClient.BeginCheckResourceCreationFeasibility method. func (client *DeviceCapacityCheckClient) BeginCheckResourceCreationFeasibility(ctx context.Context, resourceGroupName string, deviceName string, deviceCapacityRequestInfo DeviceCapacityRequestInfo, options *DeviceCapacityCheckClientBeginCheckResourceCreationFeasibilityOptions) (*runtime.Poller[DeviceCapacityCheckClientCheckResourceCreationFeasibilityResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.checkResourceCreationFeasibility(ctx, resourceGroupName, deviceName, deviceCapacityRequestInfo, options) @@ -78,6 +80,7 @@ func (client *DeviceCapacityCheckClient) BeginCheckResourceCreationFeasibility(c // CheckResourceCreationFeasibility - Posts the device capacity request info to check feasibility. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *DeviceCapacityCheckClient) checkResourceCreationFeasibility(ctx context.Context, resourceGroupName string, deviceName string, deviceCapacityRequestInfo DeviceCapacityRequestInfo, options *DeviceCapacityCheckClientBeginCheckResourceCreationFeasibilityOptions) (*http.Response, error) { req, err := client.checkResourceCreationFeasibilityCreateRequest(ctx, resourceGroupName, deviceName, deviceCapacityRequestInfo, options) diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devicecapacityinfo_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/devicecapacityinfo_client.go similarity index 90% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devicecapacityinfo_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/devicecapacityinfo_client.go index a884f45ff0ed..931f2b89af69 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devicecapacityinfo_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/devicecapacityinfo_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type DeviceCapacityInfoClient struct { } // NewDeviceCapacityInfoClient creates a new instance of DeviceCapacityInfoClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDeviceCapacityInfoClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeviceCapacityInfoClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,12 @@ func NewDeviceCapacityInfoClient(subscriptionID string, credential azcore.TokenC // GetDeviceCapacityInfo - Gets the properties of the specified device capacity info. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// resourceGroupName - The resource group name. -// deviceName - The device name. -// options - DeviceCapacityInfoClientGetDeviceCapacityInfoOptions contains the optional parameters for the DeviceCapacityInfoClient.GetDeviceCapacityInfo -// method. +// - resourceGroupName - The resource group name. +// - deviceName - The device name. +// - options - DeviceCapacityInfoClientGetDeviceCapacityInfoOptions contains the optional parameters for the DeviceCapacityInfoClient.GetDeviceCapacityInfo +// method. func (client *DeviceCapacityInfoClient) GetDeviceCapacityInfo(ctx context.Context, resourceGroupName string, deviceName string, options *DeviceCapacityInfoClientGetDeviceCapacityInfoOptions) (DeviceCapacityInfoClientGetDeviceCapacityInfoResponse, error) { req, err := client.getDeviceCapacityInfoCreateRequest(ctx, resourceGroupName, deviceName, options) if err != nil { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devices_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/devices_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devices_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/devices_client.go index 8144dd301e56..4aa5acfd1fe8 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devices_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/devices_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type DevicesClient struct { } // NewDevicesClient creates a new instance of DevicesClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDevicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DevicesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,12 @@ func NewDevicesClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or updates a Data Box Edge/Data Box Gateway resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// dataBoxEdgeDevice - The resource object. -// options - DevicesClientCreateOrUpdateOptions contains the optional parameters for the DevicesClient.CreateOrUpdate method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - dataBoxEdgeDevice - The resource object. +// - options - DevicesClientCreateOrUpdateOptions contains the optional parameters for the DevicesClient.CreateOrUpdate method. func (client *DevicesClient) CreateOrUpdate(ctx context.Context, deviceName string, resourceGroupName string, dataBoxEdgeDevice Device, options *DevicesClientCreateOrUpdateOptions) (DevicesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, deviceName, resourceGroupName, dataBoxEdgeDevice, options) if err != nil { @@ -113,12 +115,13 @@ func (client *DevicesClient) createOrUpdateHandleResponse(resp *http.Response) ( // BeginCreateOrUpdateSecuritySettings - Updates the security settings on a Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// securitySettings - The security settings. -// options - DevicesClientBeginCreateOrUpdateSecuritySettingsOptions contains the optional parameters for the DevicesClient.BeginCreateOrUpdateSecuritySettings -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - securitySettings - The security settings. +// - options - DevicesClientBeginCreateOrUpdateSecuritySettingsOptions contains the optional parameters for the DevicesClient.BeginCreateOrUpdateSecuritySettings +// method. func (client *DevicesClient) BeginCreateOrUpdateSecuritySettings(ctx context.Context, deviceName string, resourceGroupName string, securitySettings SecuritySettings, options *DevicesClientBeginCreateOrUpdateSecuritySettingsOptions) (*runtime.Poller[DevicesClientCreateOrUpdateSecuritySettingsResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdateSecuritySettings(ctx, deviceName, resourceGroupName, securitySettings, options) @@ -133,6 +136,7 @@ func (client *DevicesClient) BeginCreateOrUpdateSecuritySettings(ctx context.Con // CreateOrUpdateSecuritySettings - Updates the security settings on a Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *DevicesClient) createOrUpdateSecuritySettings(ctx context.Context, deviceName string, resourceGroupName string, securitySettings SecuritySettings, options *DevicesClientBeginCreateOrUpdateSecuritySettingsOptions) (*http.Response, error) { req, err := client.createOrUpdateSecuritySettingsCreateRequest(ctx, deviceName, resourceGroupName, securitySettings, options) @@ -177,10 +181,11 @@ func (client *DevicesClient) createOrUpdateSecuritySettingsCreateRequest(ctx con // BeginDelete - Deletes the Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - DevicesClientBeginDeleteOptions contains the optional parameters for the DevicesClient.BeginDelete method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - DevicesClientBeginDeleteOptions contains the optional parameters for the DevicesClient.BeginDelete method. func (client *DevicesClient) BeginDelete(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginDeleteOptions) (*runtime.Poller[DevicesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, deviceName, resourceGroupName, options) @@ -195,6 +200,7 @@ func (client *DevicesClient) BeginDelete(ctx context.Context, deviceName string, // Delete - Deletes the Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *DevicesClient) deleteOperation(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, deviceName, resourceGroupName, options) @@ -239,11 +245,12 @@ func (client *DevicesClient) deleteCreateRequest(ctx context.Context, deviceName // BeginDownloadUpdates - Downloads the updates on a Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - DevicesClientBeginDownloadUpdatesOptions contains the optional parameters for the DevicesClient.BeginDownloadUpdates -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - DevicesClientBeginDownloadUpdatesOptions contains the optional parameters for the DevicesClient.BeginDownloadUpdates +// method. func (client *DevicesClient) BeginDownloadUpdates(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginDownloadUpdatesOptions) (*runtime.Poller[DevicesClientDownloadUpdatesResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.downloadUpdates(ctx, deviceName, resourceGroupName, options) @@ -258,6 +265,7 @@ func (client *DevicesClient) BeginDownloadUpdates(ctx context.Context, deviceNam // DownloadUpdates - Downloads the updates on a Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *DevicesClient) downloadUpdates(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginDownloadUpdatesOptions) (*http.Response, error) { req, err := client.downloadUpdatesCreateRequest(ctx, deviceName, resourceGroupName, options) @@ -302,11 +310,12 @@ func (client *DevicesClient) downloadUpdatesCreateRequest(ctx context.Context, d // GenerateCertificate - Generates certificate for activation key. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - DevicesClientGenerateCertificateOptions contains the optional parameters for the DevicesClient.GenerateCertificate -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - DevicesClientGenerateCertificateOptions contains the optional parameters for the DevicesClient.GenerateCertificate +// method. func (client *DevicesClient) GenerateCertificate(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientGenerateCertificateOptions) (DevicesClientGenerateCertificateResponse, error) { req, err := client.generateCertificateCreateRequest(ctx, deviceName, resourceGroupName, options) if err != nil { @@ -359,10 +368,11 @@ func (client *DevicesClient) generateCertificateHandleResponse(resp *http.Respon // Get - Gets the properties of the Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - DevicesClientGetOptions contains the optional parameters for the DevicesClient.Get method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - DevicesClientGetOptions contains the optional parameters for the DevicesClient.Get method. func (client *DevicesClient) Get(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientGetOptions) (DevicesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, resourceGroupName, options) if err != nil { @@ -415,11 +425,12 @@ func (client *DevicesClient) getHandleResponse(resp *http.Response) (DevicesClie // GetExtendedInformation - Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - DevicesClientGetExtendedInformationOptions contains the optional parameters for the DevicesClient.GetExtendedInformation -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - DevicesClientGetExtendedInformationOptions contains the optional parameters for the DevicesClient.GetExtendedInformation +// method. func (client *DevicesClient) GetExtendedInformation(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientGetExtendedInformationOptions) (DevicesClientGetExtendedInformationResponse, error) { req, err := client.getExtendedInformationCreateRequest(ctx, deviceName, resourceGroupName, options) if err != nil { @@ -472,11 +483,12 @@ func (client *DevicesClient) getExtendedInformationHandleResponse(resp *http.Res // GetNetworkSettings - Gets the network settings of the specified Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - DevicesClientGetNetworkSettingsOptions contains the optional parameters for the DevicesClient.GetNetworkSettings -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - DevicesClientGetNetworkSettingsOptions contains the optional parameters for the DevicesClient.GetNetworkSettings +// method. func (client *DevicesClient) GetNetworkSettings(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientGetNetworkSettingsOptions) (DevicesClientGetNetworkSettingsResponse, error) { req, err := client.getNetworkSettingsCreateRequest(ctx, deviceName, resourceGroupName, options) if err != nil { @@ -530,11 +542,12 @@ func (client *DevicesClient) getNetworkSettingsHandleResponse(resp *http.Respons // GetUpdateSummary - Gets information about the availability of updates based on the last scan of the device. It also gets // information about any ongoing download or install jobs on the device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - DevicesClientGetUpdateSummaryOptions contains the optional parameters for the DevicesClient.GetUpdateSummary -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - DevicesClientGetUpdateSummaryOptions contains the optional parameters for the DevicesClient.GetUpdateSummary +// method. func (client *DevicesClient) GetUpdateSummary(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientGetUpdateSummaryOptions) (DevicesClientGetUpdateSummaryResponse, error) { req, err := client.getUpdateSummaryCreateRequest(ctx, deviceName, resourceGroupName, options) if err != nil { @@ -587,11 +600,12 @@ func (client *DevicesClient) getUpdateSummaryHandleResponse(resp *http.Response) // BeginInstallUpdates - Installs the updates on the Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - DevicesClientBeginInstallUpdatesOptions contains the optional parameters for the DevicesClient.BeginInstallUpdates -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - DevicesClientBeginInstallUpdatesOptions contains the optional parameters for the DevicesClient.BeginInstallUpdates +// method. func (client *DevicesClient) BeginInstallUpdates(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginInstallUpdatesOptions) (*runtime.Poller[DevicesClientInstallUpdatesResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.installUpdates(ctx, deviceName, resourceGroupName, options) @@ -606,6 +620,7 @@ func (client *DevicesClient) BeginInstallUpdates(ctx context.Context, deviceName // InstallUpdates - Installs the updates on the Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *DevicesClient) installUpdates(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginInstallUpdatesOptions) (*http.Response, error) { req, err := client.installUpdatesCreateRequest(ctx, deviceName, resourceGroupName, options) @@ -649,11 +664,11 @@ func (client *DevicesClient) installUpdatesCreateRequest(ctx context.Context, de } // NewListByResourceGroupPager - Gets all the Data Box Edge/Data Box Gateway devices in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// resourceGroupName - The resource group name. -// options - DevicesClientListByResourceGroupOptions contains the optional parameters for the DevicesClient.ListByResourceGroup -// method. +// - resourceGroupName - The resource group name. +// - options - DevicesClientListByResourceGroupOptions contains the optional parameters for the DevicesClient.NewListByResourceGroupPager +// method. func (client *DevicesClient) NewListByResourceGroupPager(resourceGroupName string, options *DevicesClientListByResourceGroupOptions) *runtime.Pager[DevicesClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[DevicesClientListByResourceGroupResponse]{ More: func(page DevicesClientListByResourceGroupResponse) bool { @@ -717,10 +732,10 @@ func (client *DevicesClient) listByResourceGroupHandleResponse(resp *http.Respon } // NewListBySubscriptionPager - Gets all the Data Box Edge/Data Box Gateway devices in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// options - DevicesClientListBySubscriptionOptions contains the optional parameters for the DevicesClient.ListBySubscription -// method. +// - options - DevicesClientListBySubscriptionOptions contains the optional parameters for the DevicesClient.NewListBySubscriptionPager +// method. func (client *DevicesClient) NewListBySubscriptionPager(options *DevicesClientListBySubscriptionOptions) *runtime.Pager[DevicesClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[DevicesClientListBySubscriptionResponse]{ More: func(page DevicesClientListBySubscriptionResponse) bool { @@ -781,11 +796,12 @@ func (client *DevicesClient) listBySubscriptionHandleResponse(resp *http.Respons // BeginScanForUpdates - Scans for updates on a Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - DevicesClientBeginScanForUpdatesOptions contains the optional parameters for the DevicesClient.BeginScanForUpdates -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - DevicesClientBeginScanForUpdatesOptions contains the optional parameters for the DevicesClient.BeginScanForUpdates +// method. func (client *DevicesClient) BeginScanForUpdates(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginScanForUpdatesOptions) (*runtime.Poller[DevicesClientScanForUpdatesResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.scanForUpdates(ctx, deviceName, resourceGroupName, options) @@ -800,6 +816,7 @@ func (client *DevicesClient) BeginScanForUpdates(ctx context.Context, deviceName // ScanForUpdates - Scans for updates on a Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *DevicesClient) scanForUpdates(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginScanForUpdatesOptions) (*http.Response, error) { req, err := client.scanForUpdatesCreateRequest(ctx, deviceName, resourceGroupName, options) @@ -844,11 +861,12 @@ func (client *DevicesClient) scanForUpdatesCreateRequest(ctx context.Context, de // Update - Modifies a Data Box Edge/Data Box Gateway resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// parameters - The resource parameters. -// options - DevicesClientUpdateOptions contains the optional parameters for the DevicesClient.Update method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - parameters - The resource parameters. +// - options - DevicesClientUpdateOptions contains the optional parameters for the DevicesClient.Update method. func (client *DevicesClient) Update(ctx context.Context, deviceName string, resourceGroupName string, parameters DevicePatch, options *DevicesClientUpdateOptions) (DevicesClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, deviceName, resourceGroupName, parameters, options) if err != nil { @@ -901,12 +919,13 @@ func (client *DevicesClient) updateHandleResponse(resp *http.Response) (DevicesC // UpdateExtendedInformation - Gets additional information for the specified Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// parameters - The patch object. -// options - DevicesClientUpdateExtendedInformationOptions contains the optional parameters for the DevicesClient.UpdateExtendedInformation -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - parameters - The patch object. +// - options - DevicesClientUpdateExtendedInformationOptions contains the optional parameters for the DevicesClient.UpdateExtendedInformation +// method. func (client *DevicesClient) UpdateExtendedInformation(ctx context.Context, deviceName string, resourceGroupName string, parameters DeviceExtendedInfoPatch, options *DevicesClientUpdateExtendedInformationOptions) (DevicesClientUpdateExtendedInformationResponse, error) { req, err := client.updateExtendedInformationCreateRequest(ctx, deviceName, resourceGroupName, parameters, options) if err != nil { @@ -959,12 +978,13 @@ func (client *DevicesClient) updateExtendedInformationHandleResponse(resp *http. // UploadCertificate - Uploads registration certificate for the device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// parameters - The upload certificate request. -// options - DevicesClientUploadCertificateOptions contains the optional parameters for the DevicesClient.UploadCertificate -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - parameters - The upload certificate request. +// - options - DevicesClientUploadCertificateOptions contains the optional parameters for the DevicesClient.UploadCertificate +// method. func (client *DevicesClient) UploadCertificate(ctx context.Context, deviceName string, resourceGroupName string, parameters UploadCertificateRequest, options *DevicesClientUploadCertificateOptions) (DevicesClientUploadCertificateResponse, error) { req, err := client.uploadCertificateCreateRequest(ctx, deviceName, resourceGroupName, parameters, options) if err != nil { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_diagnosticsettings_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/diagnosticsettings_client.go similarity index 90% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_diagnosticsettings_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/diagnosticsettings_client.go index 3548126bb21e..04f27b91fa0d 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_diagnosticsettings_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/diagnosticsettings_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type DiagnosticSettingsClient struct { } // NewDiagnosticSettingsClient creates a new instance of DiagnosticSettingsClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDiagnosticSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiagnosticSettingsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +58,12 @@ func NewDiagnosticSettingsClient(subscriptionID string, credential azcore.TokenC // GetDiagnosticProactiveLogCollectionSettings - Gets the proactive log collection settings of the specified Data Box Edge/Data // Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsOptions contains the optional parameters for -// the DiagnosticSettingsClient.GetDiagnosticProactiveLogCollectionSettings method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsOptions contains the optional parameters for +// the DiagnosticSettingsClient.GetDiagnosticProactiveLogCollectionSettings method. func (client *DiagnosticSettingsClient) GetDiagnosticProactiveLogCollectionSettings(ctx context.Context, deviceName string, resourceGroupName string, options *DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsOptions) (DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResponse, error) { req, err := client.getDiagnosticProactiveLogCollectionSettingsCreateRequest(ctx, deviceName, resourceGroupName, options) if err != nil { @@ -115,11 +117,12 @@ func (client *DiagnosticSettingsClient) getDiagnosticProactiveLogCollectionSetti // GetDiagnosticRemoteSupportSettings - Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box // Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsOptions contains the optional parameters for the DiagnosticSettingsClient.GetDiagnosticRemoteSupportSettings -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsOptions contains the optional parameters for the DiagnosticSettingsClient.GetDiagnosticRemoteSupportSettings +// method. func (client *DiagnosticSettingsClient) GetDiagnosticRemoteSupportSettings(ctx context.Context, deviceName string, resourceGroupName string, options *DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsOptions) (DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResponse, error) { req, err := client.getDiagnosticRemoteSupportSettingsCreateRequest(ctx, deviceName, resourceGroupName, options) if err != nil { @@ -173,12 +176,13 @@ func (client *DiagnosticSettingsClient) getDiagnosticRemoteSupportSettingsHandle // BeginUpdateDiagnosticProactiveLogCollectionSettings - Updates the proactive log collection settings on a Data Box Edge/Data // Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// proactiveLogCollectionSettings - The proactive log collection settings. -// options - DiagnosticSettingsClientBeginUpdateDiagnosticProactiveLogCollectionSettingsOptions contains the optional parameters -// for the DiagnosticSettingsClient.BeginUpdateDiagnosticProactiveLogCollectionSettings method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - proactiveLogCollectionSettings - The proactive log collection settings. +// - options - DiagnosticSettingsClientBeginUpdateDiagnosticProactiveLogCollectionSettingsOptions contains the optional parameters +// for the DiagnosticSettingsClient.BeginUpdateDiagnosticProactiveLogCollectionSettings method. func (client *DiagnosticSettingsClient) BeginUpdateDiagnosticProactiveLogCollectionSettings(ctx context.Context, deviceName string, resourceGroupName string, proactiveLogCollectionSettings DiagnosticProactiveLogCollectionSettings, options *DiagnosticSettingsClientBeginUpdateDiagnosticProactiveLogCollectionSettingsOptions) (*runtime.Poller[DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.updateDiagnosticProactiveLogCollectionSettings(ctx, deviceName, resourceGroupName, proactiveLogCollectionSettings, options) @@ -194,6 +198,7 @@ func (client *DiagnosticSettingsClient) BeginUpdateDiagnosticProactiveLogCollect // UpdateDiagnosticProactiveLogCollectionSettings - Updates the proactive log collection settings on a Data Box Edge/Data // Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *DiagnosticSettingsClient) updateDiagnosticProactiveLogCollectionSettings(ctx context.Context, deviceName string, resourceGroupName string, proactiveLogCollectionSettings DiagnosticProactiveLogCollectionSettings, options *DiagnosticSettingsClientBeginUpdateDiagnosticProactiveLogCollectionSettingsOptions) (*http.Response, error) { req, err := client.updateDiagnosticProactiveLogCollectionSettingsCreateRequest(ctx, deviceName, resourceGroupName, proactiveLogCollectionSettings, options) @@ -239,12 +244,13 @@ func (client *DiagnosticSettingsClient) updateDiagnosticProactiveLogCollectionSe // BeginUpdateDiagnosticRemoteSupportSettings - Updates the diagnostic remote support settings on a Data Box Edge/Data Box // Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// diagnosticRemoteSupportSettings - The diagnostic remote support settings. -// options - DiagnosticSettingsClientBeginUpdateDiagnosticRemoteSupportSettingsOptions contains the optional parameters for -// the DiagnosticSettingsClient.BeginUpdateDiagnosticRemoteSupportSettings method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - diagnosticRemoteSupportSettings - The diagnostic remote support settings. +// - options - DiagnosticSettingsClientBeginUpdateDiagnosticRemoteSupportSettingsOptions contains the optional parameters for +// the DiagnosticSettingsClient.BeginUpdateDiagnosticRemoteSupportSettings method. func (client *DiagnosticSettingsClient) BeginUpdateDiagnosticRemoteSupportSettings(ctx context.Context, deviceName string, resourceGroupName string, diagnosticRemoteSupportSettings DiagnosticRemoteSupportSettings, options *DiagnosticSettingsClientBeginUpdateDiagnosticRemoteSupportSettingsOptions) (*runtime.Poller[DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.updateDiagnosticRemoteSupportSettings(ctx, deviceName, resourceGroupName, diagnosticRemoteSupportSettings, options) @@ -260,6 +266,7 @@ func (client *DiagnosticSettingsClient) BeginUpdateDiagnosticRemoteSupportSettin // UpdateDiagnosticRemoteSupportSettings - Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway // device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *DiagnosticSettingsClient) updateDiagnosticRemoteSupportSettings(ctx context.Context, deviceName string, resourceGroupName string, diagnosticRemoteSupportSettings DiagnosticRemoteSupportSettings, options *DiagnosticSettingsClientBeginUpdateDiagnosticRemoteSupportSettingsOptions) (*http.Response, error) { req, err := client.updateDiagnosticRemoteSupportSettingsCreateRequest(ctx, deviceName, resourceGroupName, diagnosticRemoteSupportSettings, options) diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/go.mod b/sdk/resourcemanager/databoxedge/armdataboxedge/go.mod index ed8c0c8f0602..517acffca79d 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/go.mod +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/go.sum b/sdk/resourcemanager/databoxedge/armdataboxedge/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/go.sum +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_jobs_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/jobs_client.go similarity index 90% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_jobs_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/jobs_client.go index 12fb2c51f458..a05f0e9e1888 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_jobs_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/jobs_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type JobsClient struct { } // NewJobsClient creates a new instance of JobsClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,12 @@ func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, opt // Get - Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The job name. -// resourceGroupName - The resource group name. -// options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. +// - deviceName - The device name. +// - name - The job name. +// - resourceGroupName - The resource group name. +// - options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. func (client *JobsClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string, options *JobsClientGetOptions) (JobsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, name, resourceGroupName, options) if err != nil { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_models.go b/sdk/resourcemanager/databoxedge/armdataboxedge/models.go similarity index 98% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_models.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/models.go index 7a14977ce5d8..f99a4d374664 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_models.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/models.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -78,7 +79,7 @@ type AddonsClientGetOptions struct { // placeholder for future optional parameters } -// AddonsClientListByRoleOptions contains the optional parameters for the AddonsClient.ListByRole method. +// AddonsClientListByRoleOptions contains the optional parameters for the AddonsClient.NewListByRolePager method. type AddonsClientListByRoleOptions struct { // placeholder for future optional parameters } @@ -175,7 +176,7 @@ type AlertsClientGetOptions struct { // placeholder for future optional parameters } -// AlertsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the AlertsClient.ListByDataBoxEdgeDevice +// AlertsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the AlertsClient.NewListByDataBoxEdgeDevicePager // method. type AlertsClientListByDataBoxEdgeDeviceOptions struct { // placeholder for future optional parameters @@ -258,7 +259,7 @@ type Authentication struct { SymmetricKey *SymmetricKey `json:"symmetricKey,omitempty"` } -// AvailableSKUsClientListOptions contains the optional parameters for the AvailableSKUsClient.List method. +// AvailableSKUsClientListOptions contains the optional parameters for the AvailableSKUsClient.NewListPager method. type AvailableSKUsClientListOptions struct { // placeholder for future optional parameters } @@ -327,7 +328,7 @@ type BandwidthSchedulesClientGetOptions struct { // placeholder for future optional parameters } -// BandwidthSchedulesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the BandwidthSchedulesClient.ListByDataBoxEdgeDevice +// BandwidthSchedulesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the BandwidthSchedulesClient.NewListByDataBoxEdgeDevicePager // method. type BandwidthSchedulesClientListByDataBoxEdgeDeviceOptions struct { // placeholder for future optional parameters @@ -399,24 +400,6 @@ type CloudEdgeManagementRoleProperties struct { LocalManagementStatus *RoleStatus `json:"localManagementStatus,omitempty" azure:"ro"` } -// CloudError - An error response from the service. -type CloudError struct { - // The error details. - Error *CloudErrorBody `json:"error,omitempty"` -} - -// CloudErrorBody - An error response from the service. -type CloudErrorBody struct { - // An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - - // A list of additional details about the error. - Details []*CloudErrorBody `json:"details,omitempty"` - - // A message describing the error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` -} - // ClusterCapacityViewData - Cluster Compute Data. type ClusterCapacityViewData struct { // The FQDN of the cluster. @@ -597,7 +580,7 @@ type ContainersClientGetOptions struct { // placeholder for future optional parameters } -// ContainersClientListByStorageAccountOptions contains the optional parameters for the ContainersClient.ListByStorageAccount +// ContainersClientListByStorageAccountOptions contains the optional parameters for the ContainersClient.NewListByStorageAccountPager // method. type ContainersClientListByStorageAccountOptions struct { // placeholder for future optional parameters @@ -954,14 +937,16 @@ type DevicesClientGetUpdateSummaryOptions struct { // placeholder for future optional parameters } -// DevicesClientListByResourceGroupOptions contains the optional parameters for the DevicesClient.ListByResourceGroup method. +// DevicesClientListByResourceGroupOptions contains the optional parameters for the DevicesClient.NewListByResourceGroupPager +// method. type DevicesClientListByResourceGroupOptions struct { // Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= to populate the next // page in the list. Expand *string } -// DevicesClientListBySubscriptionOptions contains the optional parameters for the DevicesClient.ListBySubscription method. +// DevicesClientListBySubscriptionOptions contains the optional parameters for the DevicesClient.NewListBySubscriptionPager +// method. type DevicesClientListBySubscriptionOptions struct { // Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= to populate the next // page in the list. @@ -1746,7 +1731,7 @@ type MonitoringConfigClientGetOptions struct { // placeholder for future optional parameters } -// MonitoringConfigClientListOptions contains the optional parameters for the MonitoringConfigClient.List method. +// MonitoringConfigClientListOptions contains the optional parameters for the MonitoringConfigClient.NewListPager method. type MonitoringConfigClientListOptions struct { // placeholder for future optional parameters } @@ -1954,7 +1939,7 @@ type NodeProperties struct { NodeStatus *NodeStatus `json:"nodeStatus,omitempty" azure:"ro"` } -// NodesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the NodesClient.ListByDataBoxEdgeDevice +// NodesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the NodesClient.NewListByDataBoxEdgeDevicePager // method. type NodesClientListByDataBoxEdgeDeviceOptions struct { // placeholder for future optional parameters @@ -2023,7 +2008,7 @@ type OperationProperties struct { ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -2138,7 +2123,7 @@ type OrdersClientGetOptions struct { // placeholder for future optional parameters } -// OrdersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the OrdersClient.ListByDataBoxEdgeDevice +// OrdersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the OrdersClient.NewListByDataBoxEdgeDevicePager // method. type OrdersClientListByDataBoxEdgeDeviceOptions struct { // placeholder for future optional parameters @@ -2338,7 +2323,7 @@ type RolesClientGetOptions struct { // placeholder for future optional parameters } -// RolesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the RolesClient.ListByDataBoxEdgeDevice +// RolesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the RolesClient.NewListByDataBoxEdgeDevicePager // method. type RolesClientListByDataBoxEdgeDeviceOptions struct { // placeholder for future optional parameters @@ -2573,7 +2558,7 @@ type SharesClientGetOptions struct { // placeholder for future optional parameters } -// SharesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the SharesClient.ListByDataBoxEdgeDevice +// SharesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the SharesClient.NewListByDataBoxEdgeDevicePager // method. type SharesClientListByDataBoxEdgeDeviceOptions struct { // placeholder for future optional parameters @@ -2671,7 +2656,7 @@ type StorageAccountCredentialsClientGetOptions struct { // placeholder for future optional parameters } -// StorageAccountCredentialsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the StorageAccountCredentialsClient.ListByDataBoxEdgeDevice +// StorageAccountCredentialsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the StorageAccountCredentialsClient.NewListByDataBoxEdgeDevicePager // method. type StorageAccountCredentialsClientListByDataBoxEdgeDeviceOptions struct { // placeholder for future optional parameters @@ -2725,7 +2710,7 @@ type StorageAccountsClientGetOptions struct { // placeholder for future optional parameters } -// StorageAccountsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the StorageAccountsClient.ListByDataBoxEdgeDevice +// StorageAccountsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the StorageAccountsClient.NewListByDataBoxEdgeDevicePager // method. type StorageAccountsClientListByDataBoxEdgeDeviceOptions struct { // placeholder for future optional parameters @@ -2877,7 +2862,7 @@ type TriggersClientGetOptions struct { // placeholder for future optional parameters } -// TriggersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the TriggersClient.ListByDataBoxEdgeDevice +// TriggersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the TriggersClient.NewListByDataBoxEdgeDevicePager // method. type TriggersClientListByDataBoxEdgeDeviceOptions struct { // Specify $filter='CustomContextTag eq ' to filter on custom context tag property @@ -3141,7 +3126,7 @@ type UsersClientGetOptions struct { // placeholder for future optional parameters } -// UsersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the UsersClient.ListByDataBoxEdgeDevice +// UsersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the UsersClient.NewListByDataBoxEdgeDevicePager // method. type UsersClientListByDataBoxEdgeDeviceOptions struct { // Specify $filter='Type eq ' to filter on user type property diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/models_serde.go b/sdk/resourcemanager/databoxedge/armdataboxedge/models_serde.go new file mode 100644 index 000000000000..6ce34f2a3663 --- /dev/null +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/models_serde.go @@ -0,0 +1,6553 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armdataboxedge + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type ARMBaseModel. +func (a ARMBaseModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ARMBaseModel. +func (a *ARMBaseModel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Addon. +func (a Addon) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + objectMap["kind"] = a.Kind + populate(objectMap, "name", a.Name) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Addon. +func (a *Addon) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AddonList. +func (a AddonList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AddonList. +func (a *AddonList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + a.Value, err = unmarshalAddonClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Address. +func (a Address) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressLine1", a.AddressLine1) + populate(objectMap, "addressLine2", a.AddressLine2) + populate(objectMap, "addressLine3", a.AddressLine3) + populate(objectMap, "city", a.City) + populate(objectMap, "country", a.Country) + populate(objectMap, "postalCode", a.PostalCode) + populate(objectMap, "state", a.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Address. +func (a *Address) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "addressLine1": + err = unpopulate(val, "AddressLine1", &a.AddressLine1) + delete(rawMsg, key) + case "addressLine2": + err = unpopulate(val, "AddressLine2", &a.AddressLine2) + delete(rawMsg, key) + case "addressLine3": + err = unpopulate(val, "AddressLine3", &a.AddressLine3) + delete(rawMsg, key) + case "city": + err = unpopulate(val, "City", &a.City) + delete(rawMsg, key) + case "country": + err = unpopulate(val, "Country", &a.Country) + delete(rawMsg, key) + case "postalCode": + err = unpopulate(val, "PostalCode", &a.PostalCode) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &a.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Alert. +func (a Alert) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Alert. +func (a *Alert) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AlertErrorDetails. +func (a AlertErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorCode", a.ErrorCode) + populate(objectMap, "errorMessage", a.ErrorMessage) + populate(objectMap, "occurrences", a.Occurrences) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AlertErrorDetails. +func (a *AlertErrorDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorCode": + err = unpopulate(val, "ErrorCode", &a.ErrorCode) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &a.ErrorMessage) + delete(rawMsg, key) + case "occurrences": + err = unpopulate(val, "Occurrences", &a.Occurrences) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AlertList. +func (a AlertList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AlertList. +func (a *AlertList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AlertProperties. +func (a AlertProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "alertType", a.AlertType) + populateTimeRFC3339(objectMap, "appearedAtDateTime", a.AppearedAtDateTime) + populate(objectMap, "detailedInformation", a.DetailedInformation) + populate(objectMap, "errorDetails", a.ErrorDetails) + populate(objectMap, "recommendation", a.Recommendation) + populate(objectMap, "severity", a.Severity) + populate(objectMap, "title", a.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AlertProperties. +func (a *AlertProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alertType": + err = unpopulate(val, "AlertType", &a.AlertType) + delete(rawMsg, key) + case "appearedAtDateTime": + err = unpopulateTimeRFC3339(val, "AppearedAtDateTime", &a.AppearedAtDateTime) + delete(rawMsg, key) + case "detailedInformation": + err = unpopulate(val, "DetailedInformation", &a.DetailedInformation) + delete(rawMsg, key) + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &a.ErrorDetails) + delete(rawMsg, key) + case "recommendation": + err = unpopulate(val, "Recommendation", &a.Recommendation) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &a.Severity) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &a.Title) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArcAddon. +func (a ArcAddon) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + objectMap["kind"] = AddonTypeArcForKubernetes + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArcAddon. +func (a *ArcAddon) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArcAddonProperties. +func (a ArcAddonProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hostPlatform", a.HostPlatform) + populate(objectMap, "hostPlatformType", a.HostPlatformType) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "resourceGroupName", a.ResourceGroupName) + populate(objectMap, "resourceLocation", a.ResourceLocation) + populate(objectMap, "resourceName", a.ResourceName) + populate(objectMap, "subscriptionId", a.SubscriptionID) + populate(objectMap, "version", a.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArcAddonProperties. +func (a *ArcAddonProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hostPlatform": + err = unpopulate(val, "HostPlatform", &a.HostPlatform) + delete(rawMsg, key) + case "hostPlatformType": + err = unpopulate(val, "HostPlatformType", &a.HostPlatformType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "resourceGroupName": + err = unpopulate(val, "ResourceGroupName", &a.ResourceGroupName) + delete(rawMsg, key) + case "resourceLocation": + err = unpopulate(val, "ResourceLocation", &a.ResourceLocation) + delete(rawMsg, key) + case "resourceName": + err = unpopulate(val, "ResourceName", &a.ResourceName) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &a.SubscriptionID) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &a.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AsymmetricEncryptedSecret. +func (a AsymmetricEncryptedSecret) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "encryptionAlgorithm", a.EncryptionAlgorithm) + populate(objectMap, "encryptionCertThumbprint", a.EncryptionCertThumbprint) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AsymmetricEncryptedSecret. +func (a *AsymmetricEncryptedSecret) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "encryptionAlgorithm": + err = unpopulate(val, "EncryptionAlgorithm", &a.EncryptionAlgorithm) + delete(rawMsg, key) + case "encryptionCertThumbprint": + err = unpopulate(val, "EncryptionCertThumbprint", &a.EncryptionCertThumbprint) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Authentication. +func (a Authentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "symmetricKey", a.SymmetricKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Authentication. +func (a *Authentication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "symmetricKey": + err = unpopulate(val, "SymmetricKey", &a.SymmetricKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureContainerInfo. +func (a AzureContainerInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "containerName", a.ContainerName) + populate(objectMap, "dataFormat", a.DataFormat) + populate(objectMap, "storageAccountCredentialId", a.StorageAccountCredentialID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureContainerInfo. +func (a *AzureContainerInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "containerName": + err = unpopulate(val, "ContainerName", &a.ContainerName) + delete(rawMsg, key) + case "dataFormat": + err = unpopulate(val, "DataFormat", &a.DataFormat) + delete(rawMsg, key) + case "storageAccountCredentialId": + err = unpopulate(val, "StorageAccountCredentialID", &a.StorageAccountCredentialID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BandwidthSchedule. +func (b BandwidthSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BandwidthSchedule. +func (b *BandwidthSchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &b.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BandwidthScheduleProperties. +func (b BandwidthScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "days", b.Days) + populate(objectMap, "rateInMbps", b.RateInMbps) + populate(objectMap, "start", b.Start) + populate(objectMap, "stop", b.Stop) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BandwidthScheduleProperties. +func (b *BandwidthScheduleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "days": + err = unpopulate(val, "Days", &b.Days) + delete(rawMsg, key) + case "rateInMbps": + err = unpopulate(val, "RateInMbps", &b.RateInMbps) + delete(rawMsg, key) + case "start": + err = unpopulate(val, "Start", &b.Start) + delete(rawMsg, key) + case "stop": + err = unpopulate(val, "Stop", &b.Stop) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BandwidthSchedulesList. +func (b BandwidthSchedulesList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BandwidthSchedulesList. +func (b *BandwidthSchedulesList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &b.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClientAccessRight. +func (c ClientAccessRight) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessPermission", c.AccessPermission) + populate(objectMap, "client", c.Client) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientAccessRight. +func (c *ClientAccessRight) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessPermission": + err = unpopulate(val, "AccessPermission", &c.AccessPermission) + delete(rawMsg, key) + case "client": + err = unpopulate(val, "Client", &c.Client) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudEdgeManagementRole. +func (c CloudEdgeManagementRole) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + objectMap["kind"] = RoleTypesCloudEdgeManagement + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEdgeManagementRole. +func (c *CloudEdgeManagementRole) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &c.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudEdgeManagementRoleProperties. +func (c CloudEdgeManagementRoleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "edgeProfile", c.EdgeProfile) + populate(objectMap, "localManagementStatus", c.LocalManagementStatus) + populate(objectMap, "roleStatus", c.RoleStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEdgeManagementRoleProperties. +func (c *CloudEdgeManagementRoleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "edgeProfile": + err = unpopulate(val, "EdgeProfile", &c.EdgeProfile) + delete(rawMsg, key) + case "localManagementStatus": + err = unpopulate(val, "LocalManagementStatus", &c.LocalManagementStatus) + delete(rawMsg, key) + case "roleStatus": + err = unpopulate(val, "RoleStatus", &c.RoleStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterCapacityViewData. +func (c ClusterCapacityViewData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fqdn", c.Fqdn) + populate(objectMap, "gpuCapacity", c.GpuCapacity) + populateTimeRFC3339(objectMap, "lastRefreshedTime", c.LastRefreshedTime) + populate(objectMap, "memoryCapacity", c.MemoryCapacity) + populate(objectMap, "totalProvisionedNonHpnCores", c.TotalProvisionedNonHpnCores) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterCapacityViewData. +func (c *ClusterCapacityViewData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fqdn": + err = unpopulate(val, "Fqdn", &c.Fqdn) + delete(rawMsg, key) + case "gpuCapacity": + err = unpopulate(val, "GpuCapacity", &c.GpuCapacity) + delete(rawMsg, key) + case "lastRefreshedTime": + err = unpopulateTimeRFC3339(val, "LastRefreshedTime", &c.LastRefreshedTime) + delete(rawMsg, key) + case "memoryCapacity": + err = unpopulate(val, "MemoryCapacity", &c.MemoryCapacity) + delete(rawMsg, key) + case "totalProvisionedNonHpnCores": + err = unpopulate(val, "TotalProvisionedNonHpnCores", &c.TotalProvisionedNonHpnCores) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterGpuCapacity. +func (c ClusterGpuCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "gpuFreeUnitsCount", c.GpuFreeUnitsCount) + populate(objectMap, "gpuReservedForFailoverUnitsCount", c.GpuReservedForFailoverUnitsCount) + populate(objectMap, "gpuTotalUnitsCount", c.GpuTotalUnitsCount) + populate(objectMap, "gpuType", c.GpuType) + populate(objectMap, "gpuUsedUnitsCount", c.GpuUsedUnitsCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterGpuCapacity. +func (c *ClusterGpuCapacity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "gpuFreeUnitsCount": + err = unpopulate(val, "GpuFreeUnitsCount", &c.GpuFreeUnitsCount) + delete(rawMsg, key) + case "gpuReservedForFailoverUnitsCount": + err = unpopulate(val, "GpuReservedForFailoverUnitsCount", &c.GpuReservedForFailoverUnitsCount) + delete(rawMsg, key) + case "gpuTotalUnitsCount": + err = unpopulate(val, "GpuTotalUnitsCount", &c.GpuTotalUnitsCount) + delete(rawMsg, key) + case "gpuType": + err = unpopulate(val, "GpuType", &c.GpuType) + delete(rawMsg, key) + case "gpuUsedUnitsCount": + err = unpopulate(val, "GpuUsedUnitsCount", &c.GpuUsedUnitsCount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterMemoryCapacity. +func (c ClusterMemoryCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clusterFailoverMemoryMb", c.ClusterFailoverMemoryMb) + populate(objectMap, "clusterFragmentationMemoryMb", c.ClusterFragmentationMemoryMb) + populate(objectMap, "clusterFreeMemoryMb", c.ClusterFreeMemoryMb) + populate(objectMap, "clusterHypervReserveMemoryMb", c.ClusterHypervReserveMemoryMb) + populate(objectMap, "clusterInfraVmMemoryMb", c.ClusterInfraVMMemoryMb) + populate(objectMap, "clusterMemoryUsedByVmsMb", c.ClusterMemoryUsedByVMsMb) + populate(objectMap, "clusterNonFailoverVmMb", c.ClusterNonFailoverVMMb) + populate(objectMap, "clusterTotalMemoryMb", c.ClusterTotalMemoryMb) + populate(objectMap, "clusterUsedMemoryMb", c.ClusterUsedMemoryMb) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterMemoryCapacity. +func (c *ClusterMemoryCapacity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clusterFailoverMemoryMb": + err = unpopulate(val, "ClusterFailoverMemoryMb", &c.ClusterFailoverMemoryMb) + delete(rawMsg, key) + case "clusterFragmentationMemoryMb": + err = unpopulate(val, "ClusterFragmentationMemoryMb", &c.ClusterFragmentationMemoryMb) + delete(rawMsg, key) + case "clusterFreeMemoryMb": + err = unpopulate(val, "ClusterFreeMemoryMb", &c.ClusterFreeMemoryMb) + delete(rawMsg, key) + case "clusterHypervReserveMemoryMb": + err = unpopulate(val, "ClusterHypervReserveMemoryMb", &c.ClusterHypervReserveMemoryMb) + delete(rawMsg, key) + case "clusterInfraVmMemoryMb": + err = unpopulate(val, "ClusterInfraVMMemoryMb", &c.ClusterInfraVMMemoryMb) + delete(rawMsg, key) + case "clusterMemoryUsedByVmsMb": + err = unpopulate(val, "ClusterMemoryUsedByVMsMb", &c.ClusterMemoryUsedByVMsMb) + delete(rawMsg, key) + case "clusterNonFailoverVmMb": + err = unpopulate(val, "ClusterNonFailoverVMMb", &c.ClusterNonFailoverVMMb) + delete(rawMsg, key) + case "clusterTotalMemoryMb": + err = unpopulate(val, "ClusterTotalMemoryMb", &c.ClusterTotalMemoryMb) + delete(rawMsg, key) + case "clusterUsedMemoryMb": + err = unpopulate(val, "ClusterUsedMemoryMb", &c.ClusterUsedMemoryMb) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterStorageViewData. +func (c ClusterStorageViewData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clusterFreeStorageMb", c.ClusterFreeStorageMb) + populate(objectMap, "clusterTotalStorageMb", c.ClusterTotalStorageMb) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterStorageViewData. +func (c *ClusterStorageViewData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clusterFreeStorageMb": + err = unpopulate(val, "ClusterFreeStorageMb", &c.ClusterFreeStorageMb) + delete(rawMsg, key) + case "clusterTotalStorageMb": + err = unpopulate(val, "ClusterTotalStorageMb", &c.ClusterTotalStorageMb) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CniConfig. +func (c CniConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "podSubnet", c.PodSubnet) + populate(objectMap, "serviceSubnet", c.ServiceSubnet) + populate(objectMap, "type", c.Type) + populate(objectMap, "version", c.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CniConfig. +func (c *CniConfig) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "podSubnet": + err = unpopulate(val, "PodSubnet", &c.PodSubnet) + delete(rawMsg, key) + case "serviceSubnet": + err = unpopulate(val, "ServiceSubnet", &c.ServiceSubnet) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &c.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComputeResource. +func (c ComputeResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "memoryInGB", c.MemoryInGB) + populate(objectMap, "processorCount", c.ProcessorCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeResource. +func (c *ComputeResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "memoryInGB": + err = unpopulate(val, "MemoryInGB", &c.MemoryInGB) + delete(rawMsg, key) + case "processorCount": + err = unpopulate(val, "ProcessorCount", &c.ProcessorCount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContactDetails. +func (c ContactDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "companyName", c.CompanyName) + populate(objectMap, "contactPerson", c.ContactPerson) + populate(objectMap, "emailList", c.EmailList) + populate(objectMap, "phone", c.Phone) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactDetails. +func (c *ContactDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "companyName": + err = unpopulate(val, "CompanyName", &c.CompanyName) + delete(rawMsg, key) + case "contactPerson": + err = unpopulate(val, "ContactPerson", &c.ContactPerson) + delete(rawMsg, key) + case "emailList": + err = unpopulate(val, "EmailList", &c.EmailList) + delete(rawMsg, key) + case "phone": + err = unpopulate(val, "Phone", &c.Phone) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Container. +func (c Container) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Container. +func (c *Container) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerList. +func (c ContainerList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerList. +func (c *ContainerList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerProperties. +func (c ContainerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "containerStatus", c.ContainerStatus) + populateTimeRFC3339(objectMap, "createdDateTime", c.CreatedDateTime) + populate(objectMap, "dataFormat", c.DataFormat) + populate(objectMap, "refreshDetails", c.RefreshDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerProperties. +func (c *ContainerProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "containerStatus": + err = unpopulate(val, "ContainerStatus", &c.ContainerStatus) + delete(rawMsg, key) + case "createdDateTime": + err = unpopulateTimeRFC3339(val, "CreatedDateTime", &c.CreatedDateTime) + delete(rawMsg, key) + case "dataFormat": + err = unpopulate(val, "DataFormat", &c.DataFormat) + delete(rawMsg, key) + case "refreshDetails": + err = unpopulate(val, "RefreshDetails", &c.RefreshDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DCAccessCode. +func (d DCAccessCode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DCAccessCode. +func (d *DCAccessCode) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DCAccessCodeProperties. +func (d DCAccessCodeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authCode", d.AuthCode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DCAccessCodeProperties. +func (d *DCAccessCodeProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authCode": + err = unpopulate(val, "AuthCode", &d.AuthCode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataResidency. +func (d DataResidency) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataResidency. +func (d *DataResidency) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Device. +func (d Device) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", d.Etag) + populate(objectMap, "id", d.ID) + populate(objectMap, "identity", d.Identity) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Device. +func (d *Device) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &d.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &d.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeviceCapacityInfo. +func (d DeviceCapacityInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceCapacityInfo. +func (d *DeviceCapacityInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeviceCapacityInfoProperties. +func (d DeviceCapacityInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clusterComputeCapacityInfo", d.ClusterComputeCapacityInfo) + populate(objectMap, "clusterStorageCapacityInfo", d.ClusterStorageCapacityInfo) + populate(objectMap, "nodeCapacityInfos", d.NodeCapacityInfos) + populateTimeRFC3339(objectMap, "timeStamp", d.TimeStamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceCapacityInfoProperties. +func (d *DeviceCapacityInfoProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clusterComputeCapacityInfo": + err = unpopulate(val, "ClusterComputeCapacityInfo", &d.ClusterComputeCapacityInfo) + delete(rawMsg, key) + case "clusterStorageCapacityInfo": + err = unpopulate(val, "ClusterStorageCapacityInfo", &d.ClusterStorageCapacityInfo) + delete(rawMsg, key) + case "nodeCapacityInfos": + err = unpopulate(val, "NodeCapacityInfos", &d.NodeCapacityInfos) + delete(rawMsg, key) + case "timeStamp": + err = unpopulateTimeRFC3339(val, "TimeStamp", &d.TimeStamp) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeviceCapacityRequestInfo. +func (d DeviceCapacityRequestInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceCapacityRequestInfo. +func (d *DeviceCapacityRequestInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeviceCapacityRequestInfoProperties. +func (d DeviceCapacityRequestInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "vmPlacementQuery", d.VMPlacementQuery) + populate(objectMap, "vmPlacementResults", d.VMPlacementResults) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceCapacityRequestInfoProperties. +func (d *DeviceCapacityRequestInfoProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "vmPlacementQuery": + err = unpopulate(val, "VMPlacementQuery", &d.VMPlacementQuery) + delete(rawMsg, key) + case "vmPlacementResults": + err = unpopulate(val, "VMPlacementResults", &d.VMPlacementResults) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeviceExtendedInfo. +func (d DeviceExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceExtendedInfo. +func (d *DeviceExtendedInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeviceExtendedInfoPatch. +func (d DeviceExtendedInfoPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "channelIntegrityKeyName", d.ChannelIntegrityKeyName) + populate(objectMap, "channelIntegrityKeyVersion", d.ChannelIntegrityKeyVersion) + populate(objectMap, "clientSecretStoreId", d.ClientSecretStoreID) + populate(objectMap, "clientSecretStoreUrl", d.ClientSecretStoreURL) + populate(objectMap, "syncStatus", d.SyncStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceExtendedInfoPatch. +func (d *DeviceExtendedInfoPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "channelIntegrityKeyName": + err = unpopulate(val, "ChannelIntegrityKeyName", &d.ChannelIntegrityKeyName) + delete(rawMsg, key) + case "channelIntegrityKeyVersion": + err = unpopulate(val, "ChannelIntegrityKeyVersion", &d.ChannelIntegrityKeyVersion) + delete(rawMsg, key) + case "clientSecretStoreId": + err = unpopulate(val, "ClientSecretStoreID", &d.ClientSecretStoreID) + delete(rawMsg, key) + case "clientSecretStoreUrl": + err = unpopulate(val, "ClientSecretStoreURL", &d.ClientSecretStoreURL) + delete(rawMsg, key) + case "syncStatus": + err = unpopulate(val, "SyncStatus", &d.SyncStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeviceExtendedInfoProperties. +func (d DeviceExtendedInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "channelIntegrityKeyName", d.ChannelIntegrityKeyName) + populate(objectMap, "channelIntegrityKeyVersion", d.ChannelIntegrityKeyVersion) + populate(objectMap, "clientSecretStoreId", d.ClientSecretStoreID) + populate(objectMap, "clientSecretStoreUrl", d.ClientSecretStoreURL) + populate(objectMap, "cloudWitnessContainerName", d.CloudWitnessContainerName) + populate(objectMap, "cloudWitnessStorageAccountName", d.CloudWitnessStorageAccountName) + populate(objectMap, "cloudWitnessStorageEndpoint", d.CloudWitnessStorageEndpoint) + populate(objectMap, "clusterWitnessType", d.ClusterWitnessType) + populate(objectMap, "deviceSecrets", d.DeviceSecrets) + populate(objectMap, "encryptionKey", d.EncryptionKey) + populate(objectMap, "encryptionKeyThumbprint", d.EncryptionKeyThumbprint) + populate(objectMap, "fileShareWitnessLocation", d.FileShareWitnessLocation) + populate(objectMap, "fileShareWitnessUsername", d.FileShareWitnessUsername) + populate(objectMap, "keyVaultSyncStatus", d.KeyVaultSyncStatus) + populate(objectMap, "resourceKey", d.ResourceKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceExtendedInfoProperties. +func (d *DeviceExtendedInfoProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "channelIntegrityKeyName": + err = unpopulate(val, "ChannelIntegrityKeyName", &d.ChannelIntegrityKeyName) + delete(rawMsg, key) + case "channelIntegrityKeyVersion": + err = unpopulate(val, "ChannelIntegrityKeyVersion", &d.ChannelIntegrityKeyVersion) + delete(rawMsg, key) + case "clientSecretStoreId": + err = unpopulate(val, "ClientSecretStoreID", &d.ClientSecretStoreID) + delete(rawMsg, key) + case "clientSecretStoreUrl": + err = unpopulate(val, "ClientSecretStoreURL", &d.ClientSecretStoreURL) + delete(rawMsg, key) + case "cloudWitnessContainerName": + err = unpopulate(val, "CloudWitnessContainerName", &d.CloudWitnessContainerName) + delete(rawMsg, key) + case "cloudWitnessStorageAccountName": + err = unpopulate(val, "CloudWitnessStorageAccountName", &d.CloudWitnessStorageAccountName) + delete(rawMsg, key) + case "cloudWitnessStorageEndpoint": + err = unpopulate(val, "CloudWitnessStorageEndpoint", &d.CloudWitnessStorageEndpoint) + delete(rawMsg, key) + case "clusterWitnessType": + err = unpopulate(val, "ClusterWitnessType", &d.ClusterWitnessType) + delete(rawMsg, key) + case "deviceSecrets": + err = unpopulate(val, "DeviceSecrets", &d.DeviceSecrets) + delete(rawMsg, key) + case "encryptionKey": + err = unpopulate(val, "EncryptionKey", &d.EncryptionKey) + delete(rawMsg, key) + case "encryptionKeyThumbprint": + err = unpopulate(val, "EncryptionKeyThumbprint", &d.EncryptionKeyThumbprint) + delete(rawMsg, key) + case "fileShareWitnessLocation": + err = unpopulate(val, "FileShareWitnessLocation", &d.FileShareWitnessLocation) + delete(rawMsg, key) + case "fileShareWitnessUsername": + err = unpopulate(val, "FileShareWitnessUsername", &d.FileShareWitnessUsername) + delete(rawMsg, key) + case "keyVaultSyncStatus": + err = unpopulate(val, "KeyVaultSyncStatus", &d.KeyVaultSyncStatus) + delete(rawMsg, key) + case "resourceKey": + err = unpopulate(val, "ResourceKey", &d.ResourceKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeviceList. +func (d DeviceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceList. +func (d *DeviceList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DevicePatch. +func (d DevicePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identity", d.Identity) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DevicePatch. +func (d *DevicePatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &d.Identity) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeviceProperties. +func (d DeviceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configuredRoleTypes", d.ConfiguredRoleTypes) + populate(objectMap, "culture", d.Culture) + populate(objectMap, "dataBoxEdgeDeviceStatus", d.DataBoxEdgeDeviceStatus) + populate(objectMap, "dataResidency", d.DataResidency) + populate(objectMap, "description", d.Description) + populate(objectMap, "deviceHcsVersion", d.DeviceHcsVersion) + populate(objectMap, "deviceLocalCapacity", d.DeviceLocalCapacity) + populate(objectMap, "deviceModel", d.DeviceModel) + populate(objectMap, "deviceSoftwareVersion", d.DeviceSoftwareVersion) + populate(objectMap, "deviceType", d.DeviceType) + populate(objectMap, "edgeProfile", d.EdgeProfile) + populate(objectMap, "friendlyName", d.FriendlyName) + populate(objectMap, "modelDescription", d.ModelDescription) + populate(objectMap, "nodeCount", d.NodeCount) + populate(objectMap, "resourceMoveDetails", d.ResourceMoveDetails) + populate(objectMap, "serialNumber", d.SerialNumber) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "timeZone", d.TimeZone) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceProperties. +func (d *DeviceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configuredRoleTypes": + err = unpopulate(val, "ConfiguredRoleTypes", &d.ConfiguredRoleTypes) + delete(rawMsg, key) + case "culture": + err = unpopulate(val, "Culture", &d.Culture) + delete(rawMsg, key) + case "dataBoxEdgeDeviceStatus": + err = unpopulate(val, "DataBoxEdgeDeviceStatus", &d.DataBoxEdgeDeviceStatus) + delete(rawMsg, key) + case "dataResidency": + err = unpopulate(val, "DataResidency", &d.DataResidency) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "deviceHcsVersion": + err = unpopulate(val, "DeviceHcsVersion", &d.DeviceHcsVersion) + delete(rawMsg, key) + case "deviceLocalCapacity": + err = unpopulate(val, "DeviceLocalCapacity", &d.DeviceLocalCapacity) + delete(rawMsg, key) + case "deviceModel": + err = unpopulate(val, "DeviceModel", &d.DeviceModel) + delete(rawMsg, key) + case "deviceSoftwareVersion": + err = unpopulate(val, "DeviceSoftwareVersion", &d.DeviceSoftwareVersion) + delete(rawMsg, key) + case "deviceType": + err = unpopulate(val, "DeviceType", &d.DeviceType) + delete(rawMsg, key) + case "edgeProfile": + err = unpopulate(val, "EdgeProfile", &d.EdgeProfile) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &d.FriendlyName) + delete(rawMsg, key) + case "modelDescription": + err = unpopulate(val, "ModelDescription", &d.ModelDescription) + delete(rawMsg, key) + case "nodeCount": + err = unpopulate(val, "NodeCount", &d.NodeCount) + delete(rawMsg, key) + case "resourceMoveDetails": + err = unpopulate(val, "ResourceMoveDetails", &d.ResourceMoveDetails) + delete(rawMsg, key) + case "serialNumber": + err = unpopulate(val, "SerialNumber", &d.SerialNumber) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "timeZone": + err = unpopulate(val, "TimeZone", &d.TimeZone) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DevicePropertiesPatch. +func (d DevicePropertiesPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "edgeProfile", d.EdgeProfile) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DevicePropertiesPatch. +func (d *DevicePropertiesPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "edgeProfile": + err = unpopulate(val, "EdgeProfile", &d.EdgeProfile) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticProactiveLogCollectionSettings. +func (d DiagnosticProactiveLogCollectionSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticProactiveLogCollectionSettings. +func (d *DiagnosticProactiveLogCollectionSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticRemoteSupportSettings. +func (d DiagnosticRemoteSupportSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticRemoteSupportSettings. +func (d *DiagnosticRemoteSupportSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticRemoteSupportSettingsProperties. +func (d DiagnosticRemoteSupportSettingsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "remoteSupportSettingsList", d.RemoteSupportSettingsList) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticRemoteSupportSettingsProperties. +func (d *DiagnosticRemoteSupportSettingsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "remoteSupportSettingsList": + err = unpopulate(val, "RemoteSupportSettingsList", &d.RemoteSupportSettingsList) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EdgeProfile. +func (e EdgeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subscription", e.Subscription) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EdgeProfile. +func (e *EdgeProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "subscription": + err = unpopulate(val, "Subscription", &e.Subscription) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EdgeProfilePatch. +func (e EdgeProfilePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subscription", e.Subscription) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EdgeProfilePatch. +func (e *EdgeProfilePatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "subscription": + err = unpopulate(val, "Subscription", &e.Subscription) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EdgeProfileSubscription. +func (e EdgeProfileSubscription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "registrationDate", e.RegistrationDate) + populate(objectMap, "registrationId", e.RegistrationID) + populate(objectMap, "state", e.State) + populate(objectMap, "subscriptionId", e.SubscriptionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EdgeProfileSubscription. +func (e *EdgeProfileSubscription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "registrationDate": + err = unpopulate(val, "RegistrationDate", &e.RegistrationDate) + delete(rawMsg, key) + case "registrationId": + err = unpopulate(val, "RegistrationID", &e.RegistrationID) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &e.State) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &e.SubscriptionID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EdgeProfileSubscriptionPatch. +func (e EdgeProfileSubscriptionPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EdgeProfileSubscriptionPatch. +func (e *EdgeProfileSubscriptionPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EtcdInfo. +func (e EtcdInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", e.Type) + populate(objectMap, "version", e.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EtcdInfo. +func (e *EtcdInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &e.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileEventTrigger. +func (f FileEventTrigger) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + objectMap["kind"] = TriggerEventTypeFileEvent + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileEventTrigger. +func (f *FileEventTrigger) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &f.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileSourceInfo. +func (f FileSourceInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "shareId", f.ShareID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileSourceInfo. +func (f *FileSourceInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "shareId": + err = unpopulate(val, "ShareID", &f.ShareID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileTriggerProperties. +func (f FileTriggerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customContextTag", f.CustomContextTag) + populate(objectMap, "sinkInfo", f.SinkInfo) + populate(objectMap, "sourceInfo", f.SourceInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileTriggerProperties. +func (f *FileTriggerProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customContextTag": + err = unpopulate(val, "CustomContextTag", &f.CustomContextTag) + delete(rawMsg, key) + case "sinkInfo": + err = unpopulate(val, "SinkInfo", &f.SinkInfo) + delete(rawMsg, key) + case "sourceInfo": + err = unpopulate(val, "SourceInfo", &f.SourceInfo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GenerateCertResponse. +func (g GenerateCertResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "expiryTimeInUTC", g.ExpiryTimeInUTC) + populate(objectMap, "privateKey", g.PrivateKey) + populate(objectMap, "publicKey", g.PublicKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateCertResponse. +func (g *GenerateCertResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expiryTimeInUTC": + err = unpopulate(val, "ExpiryTimeInUTC", &g.ExpiryTimeInUTC) + delete(rawMsg, key) + case "privateKey": + err = unpopulate(val, "PrivateKey", &g.PrivateKey) + delete(rawMsg, key) + case "publicKey": + err = unpopulate(val, "PublicKey", &g.PublicKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostCapacity. +func (h HostCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "availableGpuCount", h.AvailableGpuCount) + populate(objectMap, "effectiveAvailableMemoryMbOnHost", h.EffectiveAvailableMemoryMbOnHost) + populate(objectMap, "gpuType", h.GpuType) + populate(objectMap, "hostName", h.HostName) + populate(objectMap, "numaNodesData", h.NumaNodesData) + populate(objectMap, "vmUsedMemory", h.VMUsedMemory) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostCapacity. +func (h *HostCapacity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "availableGpuCount": + err = unpopulate(val, "AvailableGpuCount", &h.AvailableGpuCount) + delete(rawMsg, key) + case "effectiveAvailableMemoryMbOnHost": + err = unpopulate(val, "EffectiveAvailableMemoryMbOnHost", &h.EffectiveAvailableMemoryMbOnHost) + delete(rawMsg, key) + case "gpuType": + err = unpopulate(val, "GpuType", &h.GpuType) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &h.HostName) + delete(rawMsg, key) + case "numaNodesData": + err = unpopulate(val, "NumaNodesData", &h.NumaNodesData) + delete(rawMsg, key) + case "vmUsedMemory": + err = unpopulate(val, "VMUsedMemory", &h.VMUsedMemory) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPv4Config. +func (i IPv4Config) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "gateway", i.Gateway) + populate(objectMap, "ipAddress", i.IPAddress) + populate(objectMap, "subnet", i.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPv4Config. +func (i *IPv4Config) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "gateway": + err = unpopulate(val, "Gateway", &i.Gateway) + delete(rawMsg, key) + case "ipAddress": + err = unpopulate(val, "IPAddress", &i.IPAddress) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &i.Subnet) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPv6Config. +func (i IPv6Config) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "gateway", i.Gateway) + populate(objectMap, "ipAddress", i.IPAddress) + populate(objectMap, "prefixLength", i.PrefixLength) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPv6Config. +func (i *IPv6Config) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "gateway": + err = unpopulate(val, "Gateway", &i.Gateway) + delete(rawMsg, key) + case "ipAddress": + err = unpopulate(val, "IPAddress", &i.IPAddress) + delete(rawMsg, key) + case "prefixLength": + err = unpopulate(val, "PrefixLength", &i.PrefixLength) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageRepositoryCredential. +func (i ImageRepositoryCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "imageRepositoryUrl", i.ImageRepositoryURL) + populate(objectMap, "password", i.Password) + populate(objectMap, "userName", i.UserName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageRepositoryCredential. +func (i *ImageRepositoryCredential) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "imageRepositoryUrl": + err = unpopulate(val, "ImageRepositoryURL", &i.ImageRepositoryURL) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &i.Password) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &i.UserName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IoTAddon. +func (i IoTAddon) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + objectMap["kind"] = AddonTypeIotEdge + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IoTAddon. +func (i *IoTAddon) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &i.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IoTAddonProperties. +func (i IoTAddonProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hostPlatform", i.HostPlatform) + populate(objectMap, "hostPlatformType", i.HostPlatformType) + populate(objectMap, "ioTDeviceDetails", i.IoTDeviceDetails) + populate(objectMap, "ioTEdgeDeviceDetails", i.IoTEdgeDeviceDetails) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "version", i.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IoTAddonProperties. +func (i *IoTAddonProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hostPlatform": + err = unpopulate(val, "HostPlatform", &i.HostPlatform) + delete(rawMsg, key) + case "hostPlatformType": + err = unpopulate(val, "HostPlatformType", &i.HostPlatformType) + delete(rawMsg, key) + case "ioTDeviceDetails": + err = unpopulate(val, "IoTDeviceDetails", &i.IoTDeviceDetails) + delete(rawMsg, key) + case "ioTEdgeDeviceDetails": + err = unpopulate(val, "IoTEdgeDeviceDetails", &i.IoTEdgeDeviceDetails) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &i.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IoTDeviceInfo. +func (i IoTDeviceInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authentication", i.Authentication) + populate(objectMap, "deviceId", i.DeviceID) + populate(objectMap, "ioTHostHub", i.IoTHostHub) + populate(objectMap, "ioTHostHubId", i.IoTHostHubID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IoTDeviceInfo. +func (i *IoTDeviceInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authentication": + err = unpopulate(val, "Authentication", &i.Authentication) + delete(rawMsg, key) + case "deviceId": + err = unpopulate(val, "DeviceID", &i.DeviceID) + delete(rawMsg, key) + case "ioTHostHub": + err = unpopulate(val, "IoTHostHub", &i.IoTHostHub) + delete(rawMsg, key) + case "ioTHostHubId": + err = unpopulate(val, "IoTHostHubID", &i.IoTHostHubID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IoTEdgeAgentInfo. +func (i IoTEdgeAgentInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "imageName", i.ImageName) + populate(objectMap, "imageRepository", i.ImageRepository) + populate(objectMap, "tag", i.Tag) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IoTEdgeAgentInfo. +func (i *IoTEdgeAgentInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "imageName": + err = unpopulate(val, "ImageName", &i.ImageName) + delete(rawMsg, key) + case "imageRepository": + err = unpopulate(val, "ImageRepository", &i.ImageRepository) + delete(rawMsg, key) + case "tag": + err = unpopulate(val, "Tag", &i.Tag) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IoTRole. +func (i IoTRole) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + objectMap["kind"] = RoleTypesIOT + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IoTRole. +func (i *IoTRole) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &i.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IoTRoleProperties. +func (i IoTRoleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "computeResource", i.ComputeResource) + populate(objectMap, "hostPlatform", i.HostPlatform) + populate(objectMap, "hostPlatformType", i.HostPlatformType) + populate(objectMap, "ioTDeviceDetails", i.IoTDeviceDetails) + populate(objectMap, "ioTEdgeAgentInfo", i.IoTEdgeAgentInfo) + populate(objectMap, "ioTEdgeDeviceDetails", i.IoTEdgeDeviceDetails) + populate(objectMap, "roleStatus", i.RoleStatus) + populate(objectMap, "shareMappings", i.ShareMappings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IoTRoleProperties. +func (i *IoTRoleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "computeResource": + err = unpopulate(val, "ComputeResource", &i.ComputeResource) + delete(rawMsg, key) + case "hostPlatform": + err = unpopulate(val, "HostPlatform", &i.HostPlatform) + delete(rawMsg, key) + case "hostPlatformType": + err = unpopulate(val, "HostPlatformType", &i.HostPlatformType) + delete(rawMsg, key) + case "ioTDeviceDetails": + err = unpopulate(val, "IoTDeviceDetails", &i.IoTDeviceDetails) + delete(rawMsg, key) + case "ioTEdgeAgentInfo": + err = unpopulate(val, "IoTEdgeAgentInfo", &i.IoTEdgeAgentInfo) + delete(rawMsg, key) + case "ioTEdgeDeviceDetails": + err = unpopulate(val, "IoTEdgeDeviceDetails", &i.IoTEdgeDeviceDetails) + delete(rawMsg, key) + case "roleStatus": + err = unpopulate(val, "RoleStatus", &i.RoleStatus) + delete(rawMsg, key) + case "shareMappings": + err = unpopulate(val, "ShareMappings", &i.ShareMappings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "endTime", j.EndTime) + populate(objectMap, "error", j.Error) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "percentComplete", j.PercentComplete) + populate(objectMap, "properties", j.Properties) + populateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "status", j.Status) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Job. +func (j *Job) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &j.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &j.PercentComplete) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &j.Status) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobErrorDetails. +func (j JobErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", j.Code) + populate(objectMap, "errorDetails", j.ErrorDetails) + populate(objectMap, "message", j.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobErrorDetails. +func (j *JobErrorDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &j.Code) + delete(rawMsg, key) + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &j.ErrorDetails) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &j.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobErrorItem. +func (j JobErrorItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", j.Code) + populate(objectMap, "message", j.Message) + populate(objectMap, "recommendations", j.Recommendations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobErrorItem. +func (j *JobErrorItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &j.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &j.Message) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &j.Recommendations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobProperties. +func (j JobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentStage", j.CurrentStage) + populate(objectMap, "downloadProgress", j.DownloadProgress) + populate(objectMap, "errorManifestFile", j.ErrorManifestFile) + populate(objectMap, "folder", j.Folder) + populate(objectMap, "installProgress", j.InstallProgress) + populate(objectMap, "jobType", j.JobType) + populate(objectMap, "refreshedEntityId", j.RefreshedEntityID) + populate(objectMap, "totalRefreshErrors", j.TotalRefreshErrors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobProperties. +func (j *JobProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentStage": + err = unpopulate(val, "CurrentStage", &j.CurrentStage) + delete(rawMsg, key) + case "downloadProgress": + err = unpopulate(val, "DownloadProgress", &j.DownloadProgress) + delete(rawMsg, key) + case "errorManifestFile": + err = unpopulate(val, "ErrorManifestFile", &j.ErrorManifestFile) + delete(rawMsg, key) + case "folder": + err = unpopulate(val, "Folder", &j.Folder) + delete(rawMsg, key) + case "installProgress": + err = unpopulate(val, "InstallProgress", &j.InstallProgress) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &j.JobType) + delete(rawMsg, key) + case "refreshedEntityId": + err = unpopulate(val, "RefreshedEntityID", &j.RefreshedEntityID) + delete(rawMsg, key) + case "totalRefreshErrors": + err = unpopulate(val, "TotalRefreshErrors", &j.TotalRefreshErrors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesClusterInfo. +func (k KubernetesClusterInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etcdInfo", k.EtcdInfo) + populate(objectMap, "nodes", k.Nodes) + populate(objectMap, "version", k.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesClusterInfo. +func (k *KubernetesClusterInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etcdInfo": + err = unpopulate(val, "EtcdInfo", &k.EtcdInfo) + delete(rawMsg, key) + case "nodes": + err = unpopulate(val, "Nodes", &k.Nodes) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &k.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesIPConfiguration. +func (k KubernetesIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipAddress", k.IPAddress) + populate(objectMap, "port", k.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesIPConfiguration. +func (k *KubernetesIPConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipAddress": + err = unpopulate(val, "IPAddress", &k.IPAddress) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &k.Port) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesRole. +func (k KubernetesRole) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", k.ID) + objectMap["kind"] = RoleTypesKubernetes + populate(objectMap, "name", k.Name) + populate(objectMap, "properties", k.Properties) + populate(objectMap, "systemData", k.SystemData) + populate(objectMap, "type", k.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesRole. +func (k *KubernetesRole) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &k.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &k.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &k.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &k.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &k.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &k.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesRoleCompute. +func (k KubernetesRoleCompute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "memoryInBytes", k.MemoryInBytes) + populate(objectMap, "processorCount", k.ProcessorCount) + populate(objectMap, "vmProfile", k.VMProfile) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesRoleCompute. +func (k *KubernetesRoleCompute) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "memoryInBytes": + err = unpopulate(val, "MemoryInBytes", &k.MemoryInBytes) + delete(rawMsg, key) + case "processorCount": + err = unpopulate(val, "ProcessorCount", &k.ProcessorCount) + delete(rawMsg, key) + case "vmProfile": + err = unpopulate(val, "VMProfile", &k.VMProfile) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesRoleNetwork. +func (k KubernetesRoleNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cniConfig", k.CniConfig) + populate(objectMap, "loadBalancerConfig", k.LoadBalancerConfig) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesRoleNetwork. +func (k *KubernetesRoleNetwork) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cniConfig": + err = unpopulate(val, "CniConfig", &k.CniConfig) + delete(rawMsg, key) + case "loadBalancerConfig": + err = unpopulate(val, "LoadBalancerConfig", &k.LoadBalancerConfig) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesRoleProperties. +func (k KubernetesRoleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hostPlatform", k.HostPlatform) + populate(objectMap, "hostPlatformType", k.HostPlatformType) + populate(objectMap, "kubernetesClusterInfo", k.KubernetesClusterInfo) + populate(objectMap, "kubernetesRoleResources", k.KubernetesRoleResources) + populate(objectMap, "provisioningState", k.ProvisioningState) + populate(objectMap, "roleStatus", k.RoleStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesRoleProperties. +func (k *KubernetesRoleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hostPlatform": + err = unpopulate(val, "HostPlatform", &k.HostPlatform) + delete(rawMsg, key) + case "hostPlatformType": + err = unpopulate(val, "HostPlatformType", &k.HostPlatformType) + delete(rawMsg, key) + case "kubernetesClusterInfo": + err = unpopulate(val, "KubernetesClusterInfo", &k.KubernetesClusterInfo) + delete(rawMsg, key) + case "kubernetesRoleResources": + err = unpopulate(val, "KubernetesRoleResources", &k.KubernetesRoleResources) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &k.ProvisioningState) + delete(rawMsg, key) + case "roleStatus": + err = unpopulate(val, "RoleStatus", &k.RoleStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesRoleResources. +func (k KubernetesRoleResources) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "compute", k.Compute) + populate(objectMap, "network", k.Network) + populate(objectMap, "storage", k.Storage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesRoleResources. +func (k *KubernetesRoleResources) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "compute": + err = unpopulate(val, "Compute", &k.Compute) + delete(rawMsg, key) + case "network": + err = unpopulate(val, "Network", &k.Network) + delete(rawMsg, key) + case "storage": + err = unpopulate(val, "Storage", &k.Storage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesRoleStorage. +func (k KubernetesRoleStorage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endpoints", k.Endpoints) + populate(objectMap, "storageClasses", k.StorageClasses) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesRoleStorage. +func (k *KubernetesRoleStorage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endpoints": + err = unpopulate(val, "Endpoints", &k.Endpoints) + delete(rawMsg, key) + case "storageClasses": + err = unpopulate(val, "StorageClasses", &k.StorageClasses) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesRoleStorageClassInfo. +func (k KubernetesRoleStorageClassInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", k.Name) + populate(objectMap, "posixCompliant", k.PosixCompliant) + populate(objectMap, "type", k.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesRoleStorageClassInfo. +func (k *KubernetesRoleStorageClassInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &k.Name) + delete(rawMsg, key) + case "posixCompliant": + err = unpopulate(val, "PosixCompliant", &k.PosixCompliant) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &k.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LoadBalancerConfig. +func (l LoadBalancerConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", l.Type) + populate(objectMap, "version", l.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerConfig. +func (l *LoadBalancerConfig) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &l.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MECRole. +func (m MECRole) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + objectMap["kind"] = RoleTypesMEC + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MECRole. +func (m *MECRole) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MECRoleProperties. +func (m MECRoleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionString", m.ConnectionString) + populate(objectMap, "controllerEndpoint", m.ControllerEndpoint) + populate(objectMap, "resourceUniqueId", m.ResourceUniqueID) + populate(objectMap, "roleStatus", m.RoleStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MECRoleProperties. +func (m *MECRoleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connectionString": + err = unpopulate(val, "ConnectionString", &m.ConnectionString) + delete(rawMsg, key) + case "controllerEndpoint": + err = unpopulate(val, "ControllerEndpoint", &m.ControllerEndpoint) + delete(rawMsg, key) + case "resourceUniqueId": + err = unpopulate(val, "ResourceUniqueID", &m.ResourceUniqueID) + delete(rawMsg, key) + case "roleStatus": + err = unpopulate(val, "RoleStatus", &m.RoleStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricConfiguration. +func (m MetricConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "counterSets", m.CounterSets) + populate(objectMap, "mdmAccount", m.MdmAccount) + populate(objectMap, "metricNameSpace", m.MetricNameSpace) + populate(objectMap, "resourceId", m.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricConfiguration. +func (m *MetricConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "counterSets": + err = unpopulate(val, "CounterSets", &m.CounterSets) + delete(rawMsg, key) + case "mdmAccount": + err = unpopulate(val, "MdmAccount", &m.MdmAccount) + delete(rawMsg, key) + case "metricNameSpace": + err = unpopulate(val, "MetricNameSpace", &m.MetricNameSpace) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &m.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricCounter. +func (m MetricCounter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalDimensions", m.AdditionalDimensions) + populate(objectMap, "dimensionFilter", m.DimensionFilter) + populate(objectMap, "instance", m.Instance) + populate(objectMap, "name", m.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricCounter. +func (m *MetricCounter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalDimensions": + err = unpopulate(val, "AdditionalDimensions", &m.AdditionalDimensions) + delete(rawMsg, key) + case "dimensionFilter": + err = unpopulate(val, "DimensionFilter", &m.DimensionFilter) + delete(rawMsg, key) + case "instance": + err = unpopulate(val, "Instance", &m.Instance) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricCounterSet. +func (m MetricCounterSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "counters", m.Counters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricCounterSet. +func (m *MetricCounterSet) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "counters": + err = unpopulate(val, "Counters", &m.Counters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricDimension. +func (m MetricDimension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceName", m.SourceName) + populate(objectMap, "sourceType", m.SourceType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricDimension. +func (m *MetricDimension) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sourceName": + err = unpopulate(val, "SourceName", &m.SourceName) + delete(rawMsg, key) + case "sourceType": + err = unpopulate(val, "SourceType", &m.SourceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricDimensionV1. +func (m MetricDimensionV1) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "name", m.Name) + populate(objectMap, "toBeExportedForShoebox", m.ToBeExportedForShoebox) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricDimensionV1. +func (m *MetricDimensionV1) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "toBeExportedForShoebox": + err = unpopulate(val, "ToBeExportedForShoebox", &m.ToBeExportedForShoebox) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricSpecificationV1. +func (m MetricSpecificationV1) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aggregationType", m.AggregationType) + populate(objectMap, "category", m.Category) + populate(objectMap, "dimensions", m.Dimensions) + populate(objectMap, "displayDescription", m.DisplayDescription) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "fillGapWithZero", m.FillGapWithZero) + populate(objectMap, "name", m.Name) + populate(objectMap, "resourceIdDimensionNameOverride", m.ResourceIDDimensionNameOverride) + populate(objectMap, "supportedAggregationTypes", m.SupportedAggregationTypes) + populate(objectMap, "supportedTimeGrainTypes", m.SupportedTimeGrainTypes) + populate(objectMap, "unit", m.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricSpecificationV1. +func (m *MetricSpecificationV1) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aggregationType": + err = unpopulate(val, "AggregationType", &m.AggregationType) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &m.Category) + delete(rawMsg, key) + case "dimensions": + err = unpopulate(val, "Dimensions", &m.Dimensions) + delete(rawMsg, key) + case "displayDescription": + err = unpopulate(val, "DisplayDescription", &m.DisplayDescription) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "fillGapWithZero": + err = unpopulate(val, "FillGapWithZero", &m.FillGapWithZero) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "resourceIdDimensionNameOverride": + err = unpopulate(val, "ResourceIDDimensionNameOverride", &m.ResourceIDDimensionNameOverride) + delete(rawMsg, key) + case "supportedAggregationTypes": + err = unpopulate(val, "SupportedAggregationTypes", &m.SupportedAggregationTypes) + delete(rawMsg, key) + case "supportedTimeGrainTypes": + err = unpopulate(val, "SupportedTimeGrainTypes", &m.SupportedTimeGrainTypes) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitoringMetricConfiguration. +func (m MonitoringMetricConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoringMetricConfiguration. +func (m *MonitoringMetricConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitoringMetricConfigurationList. +func (m MonitoringMetricConfigurationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoringMetricConfigurationList. +func (m *MonitoringMetricConfigurationList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitoringMetricConfigurationProperties. +func (m MonitoringMetricConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "metricConfigurations", m.MetricConfigurations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoringMetricConfigurationProperties. +func (m *MonitoringMetricConfigurationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metricConfigurations": + err = unpopulate(val, "MetricConfigurations", &m.MetricConfigurations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MountPointMap. +func (m MountPointMap) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "mountPoint", m.MountPoint) + populate(objectMap, "mountType", m.MountType) + populate(objectMap, "roleId", m.RoleID) + populate(objectMap, "roleType", m.RoleType) + populate(objectMap, "shareId", m.ShareID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MountPointMap. +func (m *MountPointMap) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "mountPoint": + err = unpopulate(val, "MountPoint", &m.MountPoint) + delete(rawMsg, key) + case "mountType": + err = unpopulate(val, "MountType", &m.MountType) + delete(rawMsg, key) + case "roleId": + err = unpopulate(val, "RoleID", &m.RoleID) + delete(rawMsg, key) + case "roleType": + err = unpopulate(val, "RoleType", &m.RoleType) + delete(rawMsg, key) + case "shareId": + err = unpopulate(val, "ShareID", &m.ShareID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MoveRequest. +func (m MoveRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resources", m.Resources) + populate(objectMap, "targetResourceGroup", m.TargetResourceGroup) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MoveRequest. +func (m *MoveRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resources": + err = unpopulate(val, "Resources", &m.Resources) + delete(rawMsg, key) + case "targetResourceGroup": + err = unpopulate(val, "TargetResourceGroup", &m.TargetResourceGroup) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkAdapter. +func (n NetworkAdapter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "adapterId", n.AdapterID) + populate(objectMap, "adapterPosition", n.AdapterPosition) + populate(objectMap, "dnsServers", n.DNSServers) + populate(objectMap, "dhcpStatus", n.DhcpStatus) + populate(objectMap, "ipv4Configuration", n.IPv4Configuration) + populate(objectMap, "ipv6Configuration", n.IPv6Configuration) + populate(objectMap, "ipv6LinkLocalAddress", n.IPv6LinkLocalAddress) + populate(objectMap, "index", n.Index) + populate(objectMap, "label", n.Label) + populate(objectMap, "linkSpeed", n.LinkSpeed) + populate(objectMap, "macAddress", n.MacAddress) + populate(objectMap, "networkAdapterName", n.NetworkAdapterName) + populate(objectMap, "nodeId", n.NodeID) + populate(objectMap, "rdmaStatus", n.RdmaStatus) + populate(objectMap, "status", n.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkAdapter. +func (n *NetworkAdapter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "adapterId": + err = unpopulate(val, "AdapterID", &n.AdapterID) + delete(rawMsg, key) + case "adapterPosition": + err = unpopulate(val, "AdapterPosition", &n.AdapterPosition) + delete(rawMsg, key) + case "dnsServers": + err = unpopulate(val, "DNSServers", &n.DNSServers) + delete(rawMsg, key) + case "dhcpStatus": + err = unpopulate(val, "DhcpStatus", &n.DhcpStatus) + delete(rawMsg, key) + case "ipv4Configuration": + err = unpopulate(val, "IPv4Configuration", &n.IPv4Configuration) + delete(rawMsg, key) + case "ipv6Configuration": + err = unpopulate(val, "IPv6Configuration", &n.IPv6Configuration) + delete(rawMsg, key) + case "ipv6LinkLocalAddress": + err = unpopulate(val, "IPv6LinkLocalAddress", &n.IPv6LinkLocalAddress) + delete(rawMsg, key) + case "index": + err = unpopulate(val, "Index", &n.Index) + delete(rawMsg, key) + case "label": + err = unpopulate(val, "Label", &n.Label) + delete(rawMsg, key) + case "linkSpeed": + err = unpopulate(val, "LinkSpeed", &n.LinkSpeed) + delete(rawMsg, key) + case "macAddress": + err = unpopulate(val, "MacAddress", &n.MacAddress) + delete(rawMsg, key) + case "networkAdapterName": + err = unpopulate(val, "NetworkAdapterName", &n.NetworkAdapterName) + delete(rawMsg, key) + case "nodeId": + err = unpopulate(val, "NodeID", &n.NodeID) + delete(rawMsg, key) + case "rdmaStatus": + err = unpopulate(val, "RdmaStatus", &n.RdmaStatus) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &n.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkAdapterPosition. +func (n NetworkAdapterPosition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkGroup", n.NetworkGroup) + populate(objectMap, "port", n.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkAdapterPosition. +func (n *NetworkAdapterPosition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkGroup": + err = unpopulate(val, "NetworkGroup", &n.NetworkGroup) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &n.Port) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSettings. +func (n NetworkSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSettings. +func (n *NetworkSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSettingsProperties. +func (n NetworkSettingsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkAdapters", n.NetworkAdapters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSettingsProperties. +func (n *NetworkSettingsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkAdapters": + err = unpopulate(val, "NetworkAdapters", &n.NetworkAdapters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Node. +func (n Node) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Node. +func (n *Node) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NodeInfo. +func (n NodeInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipConfiguration", n.IPConfiguration) + populate(objectMap, "name", n.Name) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NodeInfo. +func (n *NodeInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipConfiguration": + err = unpopulate(val, "IPConfiguration", &n.IPConfiguration) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NodeList. +func (n NodeList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NodeList. +func (n *NodeList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NodeProperties. +func (n NodeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nodeChassisSerialNumber", n.NodeChassisSerialNumber) + populate(objectMap, "nodeDisplayName", n.NodeDisplayName) + populate(objectMap, "nodeFriendlySoftwareVersion", n.NodeFriendlySoftwareVersion) + populate(objectMap, "nodeHcsVersion", n.NodeHcsVersion) + populate(objectMap, "nodeInstanceId", n.NodeInstanceID) + populate(objectMap, "nodeSerialNumber", n.NodeSerialNumber) + populate(objectMap, "nodeStatus", n.NodeStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NodeProperties. +func (n *NodeProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nodeChassisSerialNumber": + err = unpopulate(val, "NodeChassisSerialNumber", &n.NodeChassisSerialNumber) + delete(rawMsg, key) + case "nodeDisplayName": + err = unpopulate(val, "NodeDisplayName", &n.NodeDisplayName) + delete(rawMsg, key) + case "nodeFriendlySoftwareVersion": + err = unpopulate(val, "NodeFriendlySoftwareVersion", &n.NodeFriendlySoftwareVersion) + delete(rawMsg, key) + case "nodeHcsVersion": + err = unpopulate(val, "NodeHcsVersion", &n.NodeHcsVersion) + delete(rawMsg, key) + case "nodeInstanceId": + err = unpopulate(val, "NodeInstanceID", &n.NodeInstanceID) + delete(rawMsg, key) + case "nodeSerialNumber": + err = unpopulate(val, "NodeSerialNumber", &n.NodeSerialNumber) + delete(rawMsg, key) + case "nodeStatus": + err = unpopulate(val, "NodeStatus", &n.NodeStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NumaNodeData. +func (n NumaNodeData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "effectiveAvailableMemoryInMb", n.EffectiveAvailableMemoryInMb) + populate(objectMap, "freeVCpuIndexesForHpn", n.FreeVCPUIndexesForHpn) + populate(objectMap, "logicalCoreCountPerCore", n.LogicalCoreCountPerCore) + populate(objectMap, "numaNodeIndex", n.NumaNodeIndex) + populate(objectMap, "totalMemoryInMb", n.TotalMemoryInMb) + populate(objectMap, "vCpuIndexesForHpn", n.VCPUIndexesForHpn) + populate(objectMap, "vCpuIndexesForRoot", n.VCPUIndexesForRoot) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumaNodeData. +func (n *NumaNodeData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "effectiveAvailableMemoryInMb": + err = unpopulate(val, "EffectiveAvailableMemoryInMb", &n.EffectiveAvailableMemoryInMb) + delete(rawMsg, key) + case "freeVCpuIndexesForHpn": + err = unpopulate(val, "FreeVCPUIndexesForHpn", &n.FreeVCPUIndexesForHpn) + delete(rawMsg, key) + case "logicalCoreCountPerCore": + err = unpopulate(val, "LogicalCoreCountPerCore", &n.LogicalCoreCountPerCore) + delete(rawMsg, key) + case "numaNodeIndex": + err = unpopulate(val, "NumaNodeIndex", &n.NumaNodeIndex) + delete(rawMsg, key) + case "totalMemoryInMb": + err = unpopulate(val, "TotalMemoryInMb", &n.TotalMemoryInMb) + delete(rawMsg, key) + case "vCpuIndexesForHpn": + err = unpopulate(val, "VCPUIndexesForHpn", &n.VCPUIndexesForHpn) + delete(rawMsg, key) + case "vCpuIndexesForRoot": + err = unpopulate(val, "VCPUIndexesForRoot", &n.VCPUIndexesForRoot) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationProperties. +func (o OperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceSpecification", o.ServiceSpecification) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties. +func (o *OperationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationsList. +func (o OperationsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsList. +func (o *OperationsList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Order. +func (o Order) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", o.ID) + populate(objectMap, "kind", o.Kind) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Order. +func (o *Order) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &o.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OrderList. +func (o OrderList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OrderList. +func (o *OrderList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OrderProperties. +func (o OrderProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "contactInformation", o.ContactInformation) + populate(objectMap, "currentStatus", o.CurrentStatus) + populate(objectMap, "deliveryTrackingInfo", o.DeliveryTrackingInfo) + populate(objectMap, "orderHistory", o.OrderHistory) + populate(objectMap, "orderId", o.OrderID) + populate(objectMap, "returnTrackingInfo", o.ReturnTrackingInfo) + populate(objectMap, "serialNumber", o.SerialNumber) + populate(objectMap, "shipmentType", o.ShipmentType) + populate(objectMap, "shippingAddress", o.ShippingAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OrderProperties. +func (o *OrderProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "contactInformation": + err = unpopulate(val, "ContactInformation", &o.ContactInformation) + delete(rawMsg, key) + case "currentStatus": + err = unpopulate(val, "CurrentStatus", &o.CurrentStatus) + delete(rawMsg, key) + case "deliveryTrackingInfo": + err = unpopulate(val, "DeliveryTrackingInfo", &o.DeliveryTrackingInfo) + delete(rawMsg, key) + case "orderHistory": + err = unpopulate(val, "OrderHistory", &o.OrderHistory) + delete(rawMsg, key) + case "orderId": + err = unpopulate(val, "OrderID", &o.OrderID) + delete(rawMsg, key) + case "returnTrackingInfo": + err = unpopulate(val, "ReturnTrackingInfo", &o.ReturnTrackingInfo) + delete(rawMsg, key) + case "serialNumber": + err = unpopulate(val, "SerialNumber", &o.SerialNumber) + delete(rawMsg, key) + case "shipmentType": + err = unpopulate(val, "ShipmentType", &o.ShipmentType) + delete(rawMsg, key) + case "shippingAddress": + err = unpopulate(val, "ShippingAddress", &o.ShippingAddress) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OrderStatus. +func (o OrderStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalOrderDetails", o.AdditionalOrderDetails) + populate(objectMap, "comments", o.Comments) + populate(objectMap, "status", o.Status) + populate(objectMap, "trackingInformation", o.TrackingInformation) + populateTimeRFC3339(objectMap, "updateDateTime", o.UpdateDateTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OrderStatus. +func (o *OrderStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalOrderDetails": + err = unpopulate(val, "AdditionalOrderDetails", &o.AdditionalOrderDetails) + delete(rawMsg, key) + case "comments": + err = unpopulate(val, "Comments", &o.Comments) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) + delete(rawMsg, key) + case "trackingInformation": + err = unpopulate(val, "TrackingInformation", &o.TrackingInformation) + delete(rawMsg, key) + case "updateDateTime": + err = unpopulateTimeRFC3339(val, "UpdateDateTime", &o.UpdateDateTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PeriodicTimerEventTrigger. +func (p PeriodicTimerEventTrigger) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + objectMap["kind"] = TriggerEventTypePeriodicTimerEvent + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicTimerEventTrigger. +func (p *PeriodicTimerEventTrigger) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &p.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PeriodicTimerProperties. +func (p PeriodicTimerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customContextTag", p.CustomContextTag) + populate(objectMap, "sinkInfo", p.SinkInfo) + populate(objectMap, "sourceInfo", p.SourceInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicTimerProperties. +func (p *PeriodicTimerProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customContextTag": + err = unpopulate(val, "CustomContextTag", &p.CustomContextTag) + delete(rawMsg, key) + case "sinkInfo": + err = unpopulate(val, "SinkInfo", &p.SinkInfo) + delete(rawMsg, key) + case "sourceInfo": + err = unpopulate(val, "SourceInfo", &p.SourceInfo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PeriodicTimerSourceInfo. +func (p PeriodicTimerSourceInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "schedule", p.Schedule) + populateTimeRFC3339(objectMap, "startTime", p.StartTime) + populate(objectMap, "topic", p.Topic) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicTimerSourceInfo. +func (p *PeriodicTimerSourceInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "schedule": + err = unpopulate(val, "Schedule", &p.Schedule) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &p.StartTime) + delete(rawMsg, key) + case "topic": + err = unpopulate(val, "Topic", &p.Topic) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProactiveLogCollectionSettingsProperties. +func (p ProactiveLogCollectionSettingsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "userConsent", p.UserConsent) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProactiveLogCollectionSettingsProperties. +func (p *ProactiveLogCollectionSettingsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "userConsent": + err = unpopulate(val, "UserConsent", &p.UserConsent) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RawCertificateData. +func (r RawCertificateData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authenticationType", r.AuthenticationType) + populate(objectMap, "certificate", r.Certificate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RawCertificateData. +func (r *RawCertificateData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authenticationType": + err = unpopulate(val, "AuthenticationType", &r.AuthenticationType) + delete(rawMsg, key) + case "certificate": + err = unpopulate(val, "Certificate", &r.Certificate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RefreshDetails. +func (r RefreshDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorManifestFile", r.ErrorManifestFile) + populate(objectMap, "inProgressRefreshJobId", r.InProgressRefreshJobID) + populateTimeRFC3339(objectMap, "lastCompletedRefreshJobTimeInUTC", r.LastCompletedRefreshJobTimeInUTC) + populate(objectMap, "lastJob", r.LastJob) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RefreshDetails. +func (r *RefreshDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorManifestFile": + err = unpopulate(val, "ErrorManifestFile", &r.ErrorManifestFile) + delete(rawMsg, key) + case "inProgressRefreshJobId": + err = unpopulate(val, "InProgressRefreshJobID", &r.InProgressRefreshJobID) + delete(rawMsg, key) + case "lastCompletedRefreshJobTimeInUTC": + err = unpopulateTimeRFC3339(val, "LastCompletedRefreshJobTimeInUTC", &r.LastCompletedRefreshJobTimeInUTC) + delete(rawMsg, key) + case "lastJob": + err = unpopulate(val, "LastJob", &r.LastJob) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RemoteSupportSettings. +func (r RemoteSupportSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessLevel", r.AccessLevel) + populateTimeRFC3339(objectMap, "expirationTimeStampInUTC", r.ExpirationTimeStampInUTC) + populate(objectMap, "remoteApplicationType", r.RemoteApplicationType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RemoteSupportSettings. +func (r *RemoteSupportSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessLevel": + err = unpopulate(val, "AccessLevel", &r.AccessLevel) + delete(rawMsg, key) + case "expirationTimeStampInUTC": + err = unpopulateTimeRFC3339(val, "ExpirationTimeStampInUTC", &r.ExpirationTimeStampInUTC) + delete(rawMsg, key) + case "remoteApplicationType": + err = unpopulate(val, "RemoteApplicationType", &r.RemoteApplicationType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceIdentity. +func (r ResourceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", r.PrincipalID) + populate(objectMap, "tenantId", r.TenantID) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceIdentity. +func (r *ResourceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &r.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &r.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceMoveDetails. +func (r ResourceMoveDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "operationInProgress", r.OperationInProgress) + populateTimeRFC3339(objectMap, "operationInProgressLockTimeoutInUTC", r.OperationInProgressLockTimeoutInUTC) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceMoveDetails. +func (r *ResourceMoveDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "operationInProgress": + err = unpopulate(val, "OperationInProgress", &r.OperationInProgress) + delete(rawMsg, key) + case "operationInProgressLockTimeoutInUTC": + err = unpopulateTimeRFC3339(val, "OperationInProgressLockTimeoutInUTC", &r.OperationInProgressLockTimeoutInUTC) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Role. +func (r Role) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + objectMap["kind"] = r.Kind + populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Role. +func (r *Role) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &r.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RoleList. +func (r RoleList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RoleList. +func (r *RoleList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + r.Value, err = unmarshalRoleClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RoleSinkInfo. +func (r RoleSinkInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "roleId", r.RoleID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RoleSinkInfo. +func (r *RoleSinkInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "roleId": + err = unpopulate(val, "RoleID", &r.RoleID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiVersions", s.APIVersions) + populate(objectMap, "availability", s.Availability) + populate(objectMap, "capabilities", s.Capabilities) + populate(objectMap, "costs", s.Costs) + populate(objectMap, "family", s.Family) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "locationInfo", s.LocationInfo) + populate(objectMap, "locations", s.Locations) + populate(objectMap, "name", s.Name) + populate(objectMap, "resourceType", s.ResourceType) + populate(objectMap, "shipmentTypes", s.ShipmentTypes) + populate(objectMap, "signupOption", s.SignupOption) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiVersions": + err = unpopulate(val, "APIVersions", &s.APIVersions) + delete(rawMsg, key) + case "availability": + err = unpopulate(val, "Availability", &s.Availability) + delete(rawMsg, key) + case "capabilities": + err = unpopulate(val, "Capabilities", &s.Capabilities) + delete(rawMsg, key) + case "costs": + err = unpopulate(val, "Costs", &s.Costs) + delete(rawMsg, key) + case "family": + err = unpopulate(val, "Family", &s.Family) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "locationInfo": + err = unpopulate(val, "LocationInfo", &s.LocationInfo) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &s.Locations) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &s.ResourceType) + delete(rawMsg, key) + case "shipmentTypes": + err = unpopulate(val, "ShipmentTypes", &s.ShipmentTypes) + delete(rawMsg, key) + case "signupOption": + err = unpopulate(val, "SignupOption", &s.SignupOption) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &s.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUCapability. +func (s SKUCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapability. +func (s *SKUCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUCost. +func (s SKUCost) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "extendedUnit", s.ExtendedUnit) + populate(objectMap, "meterId", s.MeterID) + populate(objectMap, "quantity", s.Quantity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCost. +func (s *SKUCost) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "extendedUnit": + err = unpopulate(val, "ExtendedUnit", &s.ExtendedUnit) + delete(rawMsg, key) + case "meterId": + err = unpopulate(val, "MeterID", &s.MeterID) + delete(rawMsg, key) + case "quantity": + err = unpopulate(val, "Quantity", &s.Quantity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUInfo. +func (s SKUInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUInfo. +func (s *SKUInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUList. +func (s SKUList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUList. +func (s *SKUList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKULocationInfo. +func (s SKULocationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "location", s.Location) + populate(objectMap, "sites", s.Sites) + populate(objectMap, "zones", s.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKULocationInfo. +func (s *SKULocationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "sites": + err = unpopulate(val, "Sites", &s.Sites) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &s.Zones) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Secret. +func (s Secret) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "encryptedSecret", s.EncryptedSecret) + populate(objectMap, "keyVaultId", s.KeyVaultID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Secret. +func (s *Secret) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "encryptedSecret": + err = unpopulate(val, "EncryptedSecret", &s.EncryptedSecret) + delete(rawMsg, key) + case "keyVaultId": + err = unpopulate(val, "KeyVaultID", &s.KeyVaultID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecuritySettings. +func (s SecuritySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecuritySettings. +func (s *SecuritySettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecuritySettingsProperties. +func (s SecuritySettingsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deviceAdminPassword", s.DeviceAdminPassword) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecuritySettingsProperties. +func (s *SecuritySettingsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deviceAdminPassword": + err = unpopulate(val, "DeviceAdminPassword", &s.DeviceAdminPassword) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. +func (s ServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "metricSpecifications", s.MetricSpecifications) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification. +func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metricSpecifications": + err = unpopulate(val, "MetricSpecifications", &s.MetricSpecifications) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Share. +func (s Share) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Share. +func (s *Share) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ShareAccessRight. +func (s ShareAccessRight) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessType", s.AccessType) + populate(objectMap, "shareId", s.ShareID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ShareAccessRight. +func (s *ShareAccessRight) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessType": + err = unpopulate(val, "AccessType", &s.AccessType) + delete(rawMsg, key) + case "shareId": + err = unpopulate(val, "ShareID", &s.ShareID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ShareList. +func (s ShareList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ShareList. +func (s *ShareList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ShareProperties. +func (s ShareProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessProtocol", s.AccessProtocol) + populate(objectMap, "azureContainerInfo", s.AzureContainerInfo) + populate(objectMap, "clientAccessRights", s.ClientAccessRights) + populate(objectMap, "dataPolicy", s.DataPolicy) + populate(objectMap, "description", s.Description) + populate(objectMap, "monitoringStatus", s.MonitoringStatus) + populate(objectMap, "refreshDetails", s.RefreshDetails) + populate(objectMap, "shareMappings", s.ShareMappings) + populate(objectMap, "shareStatus", s.ShareStatus) + populate(objectMap, "userAccessRights", s.UserAccessRights) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ShareProperties. +func (s *ShareProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessProtocol": + err = unpopulate(val, "AccessProtocol", &s.AccessProtocol) + delete(rawMsg, key) + case "azureContainerInfo": + err = unpopulate(val, "AzureContainerInfo", &s.AzureContainerInfo) + delete(rawMsg, key) + case "clientAccessRights": + err = unpopulate(val, "ClientAccessRights", &s.ClientAccessRights) + delete(rawMsg, key) + case "dataPolicy": + err = unpopulate(val, "DataPolicy", &s.DataPolicy) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "monitoringStatus": + err = unpopulate(val, "MonitoringStatus", &s.MonitoringStatus) + delete(rawMsg, key) + case "refreshDetails": + err = unpopulate(val, "RefreshDetails", &s.RefreshDetails) + delete(rawMsg, key) + case "shareMappings": + err = unpopulate(val, "ShareMappings", &s.ShareMappings) + delete(rawMsg, key) + case "shareStatus": + err = unpopulate(val, "ShareStatus", &s.ShareStatus) + delete(rawMsg, key) + case "userAccessRights": + err = unpopulate(val, "UserAccessRights", &s.UserAccessRights) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StorageAccount. +func (s StorageAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageAccount. +func (s *StorageAccount) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StorageAccountCredential. +func (s StorageAccountCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageAccountCredential. +func (s *StorageAccountCredential) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StorageAccountCredentialList. +func (s StorageAccountCredentialList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageAccountCredentialList. +func (s *StorageAccountCredentialList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StorageAccountCredentialProperties. +func (s StorageAccountCredentialProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountKey", s.AccountKey) + populate(objectMap, "accountType", s.AccountType) + populate(objectMap, "alias", s.Alias) + populate(objectMap, "blobDomainName", s.BlobDomainName) + populate(objectMap, "connectionString", s.ConnectionString) + populate(objectMap, "sslStatus", s.SSLStatus) + populate(objectMap, "storageAccountId", s.StorageAccountID) + populate(objectMap, "userName", s.UserName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageAccountCredentialProperties. +func (s *StorageAccountCredentialProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accountKey": + err = unpopulate(val, "AccountKey", &s.AccountKey) + delete(rawMsg, key) + case "accountType": + err = unpopulate(val, "AccountType", &s.AccountType) + delete(rawMsg, key) + case "alias": + err = unpopulate(val, "Alias", &s.Alias) + delete(rawMsg, key) + case "blobDomainName": + err = unpopulate(val, "BlobDomainName", &s.BlobDomainName) + delete(rawMsg, key) + case "connectionString": + err = unpopulate(val, "ConnectionString", &s.ConnectionString) + delete(rawMsg, key) + case "sslStatus": + err = unpopulate(val, "SSLStatus", &s.SSLStatus) + delete(rawMsg, key) + case "storageAccountId": + err = unpopulate(val, "StorageAccountID", &s.StorageAccountID) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &s.UserName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StorageAccountList. +func (s StorageAccountList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageAccountList. +func (s *StorageAccountList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StorageAccountProperties. +func (s StorageAccountProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobEndpoint", s.BlobEndpoint) + populate(objectMap, "containerCount", s.ContainerCount) + populate(objectMap, "dataPolicy", s.DataPolicy) + populate(objectMap, "description", s.Description) + populate(objectMap, "storageAccountCredentialId", s.StorageAccountCredentialID) + populate(objectMap, "storageAccountStatus", s.StorageAccountStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageAccountProperties. +func (s *StorageAccountProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobEndpoint": + err = unpopulate(val, "BlobEndpoint", &s.BlobEndpoint) + delete(rawMsg, key) + case "containerCount": + err = unpopulate(val, "ContainerCount", &s.ContainerCount) + delete(rawMsg, key) + case "dataPolicy": + err = unpopulate(val, "DataPolicy", &s.DataPolicy) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "storageAccountCredentialId": + err = unpopulate(val, "StorageAccountCredentialID", &s.StorageAccountCredentialID) + delete(rawMsg, key) + case "storageAccountStatus": + err = unpopulate(val, "StorageAccountStatus", &s.StorageAccountStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionProperties. +func (s SubscriptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "locationPlacementId", s.LocationPlacementID) + populate(objectMap, "quotaId", s.QuotaID) + populate(objectMap, "registeredFeatures", s.RegisteredFeatures) + populate(objectMap, "serializedDetails", s.SerializedDetails) + populate(objectMap, "tenantId", s.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionProperties. +func (s *SubscriptionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "locationPlacementId": + err = unpopulate(val, "LocationPlacementID", &s.LocationPlacementID) + delete(rawMsg, key) + case "quotaId": + err = unpopulate(val, "QuotaID", &s.QuotaID) + delete(rawMsg, key) + case "registeredFeatures": + err = unpopulate(val, "RegisteredFeatures", &s.RegisteredFeatures) + delete(rawMsg, key) + case "serializedDetails": + err = unpopulate(val, "SerializedDetails", &s.SerializedDetails) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &s.TenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionRegisteredFeatures. +func (s SubscriptionRegisteredFeatures) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + populate(objectMap, "state", s.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionRegisteredFeatures. +func (s *SubscriptionRegisteredFeatures) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SupportPackageRequestProperties. +func (s SupportPackageRequestProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "include", s.Include) + populateTimeRFC3339(objectMap, "maximumTimeStamp", s.MaximumTimeStamp) + populateTimeRFC3339(objectMap, "minimumTimeStamp", s.MinimumTimeStamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SupportPackageRequestProperties. +func (s *SupportPackageRequestProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "include": + err = unpopulate(val, "Include", &s.Include) + delete(rawMsg, key) + case "maximumTimeStamp": + err = unpopulateTimeRFC3339(val, "MaximumTimeStamp", &s.MaximumTimeStamp) + delete(rawMsg, key) + case "minimumTimeStamp": + err = unpopulateTimeRFC3339(val, "MinimumTimeStamp", &s.MinimumTimeStamp) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SymmetricKey. +func (s SymmetricKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionString", s.ConnectionString) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SymmetricKey. +func (s *SymmetricKey) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connectionString": + err = unpopulate(val, "ConnectionString", &s.ConnectionString) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrackingInfo. +func (t TrackingInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "carrierName", t.CarrierName) + populate(objectMap, "serialNumber", t.SerialNumber) + populate(objectMap, "trackingId", t.TrackingID) + populate(objectMap, "trackingUrl", t.TrackingURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackingInfo. +func (t *TrackingInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "carrierName": + err = unpopulate(val, "CarrierName", &t.CarrierName) + delete(rawMsg, key) + case "serialNumber": + err = unpopulate(val, "SerialNumber", &t.SerialNumber) + delete(rawMsg, key) + case "trackingId": + err = unpopulate(val, "TrackingID", &t.TrackingID) + delete(rawMsg, key) + case "trackingUrl": + err = unpopulate(val, "TrackingURL", &t.TrackingURL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Trigger. +func (t Trigger) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + objectMap["kind"] = t.Kind + populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Trigger. +func (t *Trigger) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &t.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TriggerList. +func (t TriggerList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerList. +func (t *TriggerList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + t.Value, err = unmarshalTriggerClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TriggerSupportPackageRequest. +func (t TriggerSupportPackageRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerSupportPackageRequest. +func (t *TriggerSupportPackageRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateDetails. +func (u UpdateDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "estimatedInstallTimeInMins", u.EstimatedInstallTimeInMins) + populate(objectMap, "friendlyVersionNumber", u.FriendlyVersionNumber) + populate(objectMap, "installationImpact", u.InstallationImpact) + populate(objectMap, "rebootBehavior", u.RebootBehavior) + populate(objectMap, "status", u.Status) + populate(objectMap, "targetVersion", u.TargetVersion) + populate(objectMap, "updateSize", u.UpdateSize) + populate(objectMap, "updateTitle", u.UpdateTitle) + populate(objectMap, "updateType", u.UpdateType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateDetails. +func (u *UpdateDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "estimatedInstallTimeInMins": + err = unpopulate(val, "EstimatedInstallTimeInMins", &u.EstimatedInstallTimeInMins) + delete(rawMsg, key) + case "friendlyVersionNumber": + err = unpopulate(val, "FriendlyVersionNumber", &u.FriendlyVersionNumber) + delete(rawMsg, key) + case "installationImpact": + err = unpopulate(val, "InstallationImpact", &u.InstallationImpact) + delete(rawMsg, key) + case "rebootBehavior": + err = unpopulate(val, "RebootBehavior", &u.RebootBehavior) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &u.Status) + delete(rawMsg, key) + case "targetVersion": + err = unpopulate(val, "TargetVersion", &u.TargetVersion) + delete(rawMsg, key) + case "updateSize": + err = unpopulate(val, "UpdateSize", &u.UpdateSize) + delete(rawMsg, key) + case "updateTitle": + err = unpopulate(val, "UpdateTitle", &u.UpdateTitle) + delete(rawMsg, key) + case "updateType": + err = unpopulate(val, "UpdateType", &u.UpdateType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateDownloadProgress. +func (u UpdateDownloadProgress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "downloadPhase", u.DownloadPhase) + populate(objectMap, "numberOfUpdatesDownloaded", u.NumberOfUpdatesDownloaded) + populate(objectMap, "numberOfUpdatesToDownload", u.NumberOfUpdatesToDownload) + populate(objectMap, "percentComplete", u.PercentComplete) + populate(objectMap, "totalBytesDownloaded", u.TotalBytesDownloaded) + populate(objectMap, "totalBytesToDownload", u.TotalBytesToDownload) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateDownloadProgress. +func (u *UpdateDownloadProgress) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "downloadPhase": + err = unpopulate(val, "DownloadPhase", &u.DownloadPhase) + delete(rawMsg, key) + case "numberOfUpdatesDownloaded": + err = unpopulate(val, "NumberOfUpdatesDownloaded", &u.NumberOfUpdatesDownloaded) + delete(rawMsg, key) + case "numberOfUpdatesToDownload": + err = unpopulate(val, "NumberOfUpdatesToDownload", &u.NumberOfUpdatesToDownload) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &u.PercentComplete) + delete(rawMsg, key) + case "totalBytesDownloaded": + err = unpopulate(val, "TotalBytesDownloaded", &u.TotalBytesDownloaded) + delete(rawMsg, key) + case "totalBytesToDownload": + err = unpopulate(val, "TotalBytesToDownload", &u.TotalBytesToDownload) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateInstallProgress. +func (u UpdateInstallProgress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "numberOfUpdatesInstalled", u.NumberOfUpdatesInstalled) + populate(objectMap, "numberOfUpdatesToInstall", u.NumberOfUpdatesToInstall) + populate(objectMap, "percentComplete", u.PercentComplete) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateInstallProgress. +func (u *UpdateInstallProgress) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "numberOfUpdatesInstalled": + err = unpopulate(val, "NumberOfUpdatesInstalled", &u.NumberOfUpdatesInstalled) + delete(rawMsg, key) + case "numberOfUpdatesToInstall": + err = unpopulate(val, "NumberOfUpdatesToInstall", &u.NumberOfUpdatesToInstall) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &u.PercentComplete) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateSummary. +func (u UpdateSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", u.ID) + populate(objectMap, "name", u.Name) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "systemData", u.SystemData) + populate(objectMap, "type", u.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateSummary. +func (u *UpdateSummary) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &u.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &u.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateSummaryProperties. +func (u UpdateSummaryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "deviceLastScannedDateTime", u.DeviceLastScannedDateTime) + populate(objectMap, "deviceVersionNumber", u.DeviceVersionNumber) + populate(objectMap, "friendlyDeviceVersionName", u.FriendlyDeviceVersionName) + populate(objectMap, "inProgressDownloadJobId", u.InProgressDownloadJobID) + populateTimeRFC3339(objectMap, "inProgressDownloadJobStartedDateTime", u.InProgressDownloadJobStartedDateTime) + populate(objectMap, "inProgressInstallJobId", u.InProgressInstallJobID) + populateTimeRFC3339(objectMap, "inProgressInstallJobStartedDateTime", u.InProgressInstallJobStartedDateTime) + populateTimeRFC3339(objectMap, "lastCompletedDownloadJobDateTime", u.LastCompletedDownloadJobDateTime) + populate(objectMap, "lastCompletedDownloadJobId", u.LastCompletedDownloadJobID) + populateTimeRFC3339(objectMap, "lastCompletedInstallJobDateTime", u.LastCompletedInstallJobDateTime) + populate(objectMap, "lastCompletedInstallJobId", u.LastCompletedInstallJobID) + populateTimeRFC3339(objectMap, "lastCompletedScanJobDateTime", u.LastCompletedScanJobDateTime) + populate(objectMap, "lastDownloadJobStatus", u.LastDownloadJobStatus) + populate(objectMap, "lastInstallJobStatus", u.LastInstallJobStatus) + populateTimeRFC3339(objectMap, "lastSuccessfulInstallJobDateTime", u.LastSuccessfulInstallJobDateTime) + populateTimeRFC3339(objectMap, "lastSuccessfulScanJobTime", u.LastSuccessfulScanJobTime) + populate(objectMap, "ongoingUpdateOperation", u.OngoingUpdateOperation) + populate(objectMap, "rebootBehavior", u.RebootBehavior) + populate(objectMap, "totalNumberOfUpdatesAvailable", u.TotalNumberOfUpdatesAvailable) + populate(objectMap, "totalNumberOfUpdatesPendingDownload", u.TotalNumberOfUpdatesPendingDownload) + populate(objectMap, "totalNumberOfUpdatesPendingInstall", u.TotalNumberOfUpdatesPendingInstall) + populate(objectMap, "totalTimeInMinutes", u.TotalTimeInMinutes) + populate(objectMap, "totalUpdateSizeInBytes", u.TotalUpdateSizeInBytes) + populate(objectMap, "updateTitles", u.UpdateTitles) + populate(objectMap, "updates", u.Updates) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateSummaryProperties. +func (u *UpdateSummaryProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deviceLastScannedDateTime": + err = unpopulateTimeRFC3339(val, "DeviceLastScannedDateTime", &u.DeviceLastScannedDateTime) + delete(rawMsg, key) + case "deviceVersionNumber": + err = unpopulate(val, "DeviceVersionNumber", &u.DeviceVersionNumber) + delete(rawMsg, key) + case "friendlyDeviceVersionName": + err = unpopulate(val, "FriendlyDeviceVersionName", &u.FriendlyDeviceVersionName) + delete(rawMsg, key) + case "inProgressDownloadJobId": + err = unpopulate(val, "InProgressDownloadJobID", &u.InProgressDownloadJobID) + delete(rawMsg, key) + case "inProgressDownloadJobStartedDateTime": + err = unpopulateTimeRFC3339(val, "InProgressDownloadJobStartedDateTime", &u.InProgressDownloadJobStartedDateTime) + delete(rawMsg, key) + case "inProgressInstallJobId": + err = unpopulate(val, "InProgressInstallJobID", &u.InProgressInstallJobID) + delete(rawMsg, key) + case "inProgressInstallJobStartedDateTime": + err = unpopulateTimeRFC3339(val, "InProgressInstallJobStartedDateTime", &u.InProgressInstallJobStartedDateTime) + delete(rawMsg, key) + case "lastCompletedDownloadJobDateTime": + err = unpopulateTimeRFC3339(val, "LastCompletedDownloadJobDateTime", &u.LastCompletedDownloadJobDateTime) + delete(rawMsg, key) + case "lastCompletedDownloadJobId": + err = unpopulate(val, "LastCompletedDownloadJobID", &u.LastCompletedDownloadJobID) + delete(rawMsg, key) + case "lastCompletedInstallJobDateTime": + err = unpopulateTimeRFC3339(val, "LastCompletedInstallJobDateTime", &u.LastCompletedInstallJobDateTime) + delete(rawMsg, key) + case "lastCompletedInstallJobId": + err = unpopulate(val, "LastCompletedInstallJobID", &u.LastCompletedInstallJobID) + delete(rawMsg, key) + case "lastCompletedScanJobDateTime": + err = unpopulateTimeRFC3339(val, "LastCompletedScanJobDateTime", &u.LastCompletedScanJobDateTime) + delete(rawMsg, key) + case "lastDownloadJobStatus": + err = unpopulate(val, "LastDownloadJobStatus", &u.LastDownloadJobStatus) + delete(rawMsg, key) + case "lastInstallJobStatus": + err = unpopulate(val, "LastInstallJobStatus", &u.LastInstallJobStatus) + delete(rawMsg, key) + case "lastSuccessfulInstallJobDateTime": + err = unpopulateTimeRFC3339(val, "LastSuccessfulInstallJobDateTime", &u.LastSuccessfulInstallJobDateTime) + delete(rawMsg, key) + case "lastSuccessfulScanJobTime": + err = unpopulateTimeRFC3339(val, "LastSuccessfulScanJobTime", &u.LastSuccessfulScanJobTime) + delete(rawMsg, key) + case "ongoingUpdateOperation": + err = unpopulate(val, "OngoingUpdateOperation", &u.OngoingUpdateOperation) + delete(rawMsg, key) + case "rebootBehavior": + err = unpopulate(val, "RebootBehavior", &u.RebootBehavior) + delete(rawMsg, key) + case "totalNumberOfUpdatesAvailable": + err = unpopulate(val, "TotalNumberOfUpdatesAvailable", &u.TotalNumberOfUpdatesAvailable) + delete(rawMsg, key) + case "totalNumberOfUpdatesPendingDownload": + err = unpopulate(val, "TotalNumberOfUpdatesPendingDownload", &u.TotalNumberOfUpdatesPendingDownload) + delete(rawMsg, key) + case "totalNumberOfUpdatesPendingInstall": + err = unpopulate(val, "TotalNumberOfUpdatesPendingInstall", &u.TotalNumberOfUpdatesPendingInstall) + delete(rawMsg, key) + case "totalTimeInMinutes": + err = unpopulate(val, "TotalTimeInMinutes", &u.TotalTimeInMinutes) + delete(rawMsg, key) + case "totalUpdateSizeInBytes": + err = unpopulate(val, "TotalUpdateSizeInBytes", &u.TotalUpdateSizeInBytes) + delete(rawMsg, key) + case "updateTitles": + err = unpopulate(val, "UpdateTitles", &u.UpdateTitles) + delete(rawMsg, key) + case "updates": + err = unpopulate(val, "Updates", &u.Updates) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UploadCertificateRequest. +func (u UploadCertificateRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", u.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UploadCertificateRequest. +func (u *UploadCertificateRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UploadCertificateResponse. +func (u UploadCertificateResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aadAudience", u.AADAudience) + populate(objectMap, "aadAuthority", u.AADAuthority) + populate(objectMap, "aadTenantId", u.AADTenantID) + populate(objectMap, "authType", u.AuthType) + populate(objectMap, "azureManagementEndpointAudience", u.AzureManagementEndpointAudience) + populate(objectMap, "resourceId", u.ResourceID) + populate(objectMap, "servicePrincipalClientId", u.ServicePrincipalClientID) + populate(objectMap, "servicePrincipalObjectId", u.ServicePrincipalObjectID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UploadCertificateResponse. +func (u *UploadCertificateResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aadAudience": + err = unpopulate(val, "AADAudience", &u.AADAudience) + delete(rawMsg, key) + case "aadAuthority": + err = unpopulate(val, "AADAuthority", &u.AADAuthority) + delete(rawMsg, key) + case "aadTenantId": + err = unpopulate(val, "AADTenantID", &u.AADTenantID) + delete(rawMsg, key) + case "authType": + err = unpopulate(val, "AuthType", &u.AuthType) + delete(rawMsg, key) + case "azureManagementEndpointAudience": + err = unpopulate(val, "AzureManagementEndpointAudience", &u.AzureManagementEndpointAudience) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &u.ResourceID) + delete(rawMsg, key) + case "servicePrincipalClientId": + err = unpopulate(val, "ServicePrincipalClientID", &u.ServicePrincipalClientID) + delete(rawMsg, key) + case "servicePrincipalObjectId": + err = unpopulate(val, "ServicePrincipalObjectID", &u.ServicePrincipalObjectID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type User. +func (u User) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", u.ID) + populate(objectMap, "name", u.Name) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "systemData", u.SystemData) + populate(objectMap, "type", u.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type User. +func (u *User) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &u.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &u.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserAccessRight. +func (u UserAccessRight) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessType", u.AccessType) + populate(objectMap, "userId", u.UserID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAccessRight. +func (u *UserAccessRight) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessType": + err = unpopulate(val, "AccessType", &u.AccessType) + delete(rawMsg, key) + case "userId": + err = unpopulate(val, "UserID", &u.UserID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserList. +func (u UserList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserList. +func (u *UserList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &u.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserProperties. +func (u UserProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "encryptedPassword", u.EncryptedPassword) + populate(objectMap, "shareAccessRights", u.ShareAccessRights) + populate(objectMap, "userType", u.UserType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserProperties. +func (u *UserProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "encryptedPassword": + err = unpopulate(val, "EncryptedPassword", &u.EncryptedPassword) + delete(rawMsg, key) + case "shareAccessRights": + err = unpopulate(val, "ShareAccessRights", &u.ShareAccessRights) + delete(rawMsg, key) + case "userType": + err = unpopulate(val, "UserType", &u.UserType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VMMemory. +func (v VMMemory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentMemoryUsageMB", v.CurrentMemoryUsageMB) + populate(objectMap, "startupMemoryMB", v.StartupMemoryMB) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VMMemory. +func (v *VMMemory) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentMemoryUsageMB": + err = unpopulate(val, "CurrentMemoryUsageMB", &v.CurrentMemoryUsageMB) + delete(rawMsg, key) + case "startupMemoryMB": + err = unpopulate(val, "StartupMemoryMB", &v.StartupMemoryMB) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VMPlacementRequestResult. +func (v VMPlacementRequestResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isFeasible", v.IsFeasible) + populate(objectMap, "message", v.Message) + populate(objectMap, "messageCode", v.MessageCode) + populate(objectMap, "vmSize", v.VMSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VMPlacementRequestResult. +func (v *VMPlacementRequestResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "isFeasible": + err = unpopulate(val, "IsFeasible", &v.IsFeasible) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &v.Message) + delete(rawMsg, key) + case "messageCode": + err = unpopulate(val, "MessageCode", &v.MessageCode) + delete(rawMsg, key) + case "vmSize": + err = unpopulate(val, "VMSize", &v.VMSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +func populate(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v any) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_monitoringconfig_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/monitoringconfig_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_monitoringconfig_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/monitoringconfig_client.go index 2655272c0af5..d8517de06fba 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_monitoringconfig_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/monitoringconfig_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type MonitoringConfigClient struct { } // NewMonitoringConfigClient creates a new instance of MonitoringConfigClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewMonitoringConfigClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MonitoringConfigClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewMonitoringConfigClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates a new metric configuration or updates an existing one for a role. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// roleName - The role name. -// resourceGroupName - The resource group name. -// monitoringMetricConfiguration - The metric configuration. -// options - MonitoringConfigClientBeginCreateOrUpdateOptions contains the optional parameters for the MonitoringConfigClient.BeginCreateOrUpdate -// method. +// - deviceName - The device name. +// - roleName - The role name. +// - resourceGroupName - The resource group name. +// - monitoringMetricConfiguration - The metric configuration. +// - options - MonitoringConfigClientBeginCreateOrUpdateOptions contains the optional parameters for the MonitoringConfigClient.BeginCreateOrUpdate +// method. func (client *MonitoringConfigClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, roleName string, resourceGroupName string, monitoringMetricConfiguration MonitoringMetricConfiguration, options *MonitoringConfigClientBeginCreateOrUpdateOptions) (*runtime.Poller[MonitoringConfigClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, deviceName, roleName, resourceGroupName, monitoringMetricConfiguration, options) @@ -77,6 +79,7 @@ func (client *MonitoringConfigClient) BeginCreateOrUpdate(ctx context.Context, d // CreateOrUpdate - Creates a new metric configuration or updates an existing one for a role. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *MonitoringConfigClient) createOrUpdate(ctx context.Context, deviceName string, roleName string, resourceGroupName string, monitoringMetricConfiguration MonitoringMetricConfiguration, options *MonitoringConfigClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, deviceName, roleName, resourceGroupName, monitoringMetricConfiguration, options) @@ -125,12 +128,13 @@ func (client *MonitoringConfigClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - deletes a new metric configuration for a role. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// roleName - The role name. -// resourceGroupName - The resource group name. -// options - MonitoringConfigClientBeginDeleteOptions contains the optional parameters for the MonitoringConfigClient.BeginDelete -// method. +// - deviceName - The device name. +// - roleName - The role name. +// - resourceGroupName - The resource group name. +// - options - MonitoringConfigClientBeginDeleteOptions contains the optional parameters for the MonitoringConfigClient.BeginDelete +// method. func (client *MonitoringConfigClient) BeginDelete(ctx context.Context, deviceName string, roleName string, resourceGroupName string, options *MonitoringConfigClientBeginDeleteOptions) (*runtime.Poller[MonitoringConfigClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, deviceName, roleName, resourceGroupName, options) @@ -145,6 +149,7 @@ func (client *MonitoringConfigClient) BeginDelete(ctx context.Context, deviceNam // Delete - deletes a new metric configuration for a role. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *MonitoringConfigClient) deleteOperation(ctx context.Context, deviceName string, roleName string, resourceGroupName string, options *MonitoringConfigClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, deviceName, roleName, resourceGroupName, options) @@ -193,11 +198,12 @@ func (client *MonitoringConfigClient) deleteCreateRequest(ctx context.Context, d // Get - Gets a metric configuration of a role. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// roleName - The role name. -// resourceGroupName - The resource group name. -// options - MonitoringConfigClientGetOptions contains the optional parameters for the MonitoringConfigClient.Get method. +// - deviceName - The device name. +// - roleName - The role name. +// - resourceGroupName - The resource group name. +// - options - MonitoringConfigClientGetOptions contains the optional parameters for the MonitoringConfigClient.Get method. func (client *MonitoringConfigClient) Get(ctx context.Context, deviceName string, roleName string, resourceGroupName string, options *MonitoringConfigClientGetOptions) (MonitoringConfigClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, roleName, resourceGroupName, options) if err != nil { @@ -253,12 +259,13 @@ func (client *MonitoringConfigClient) getHandleResponse(resp *http.Response) (Mo } // NewListPager - Lists metric configurations in a role. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// roleName - The role name. -// resourceGroupName - The resource group name. -// options - MonitoringConfigClientListOptions contains the optional parameters for the MonitoringConfigClient.List method. +// - deviceName - The device name. +// - roleName - The role name. +// - resourceGroupName - The resource group name. +// - options - MonitoringConfigClientListOptions contains the optional parameters for the MonitoringConfigClient.NewListPager +// method. func (client *MonitoringConfigClient) NewListPager(deviceName string, roleName string, resourceGroupName string, options *MonitoringConfigClientListOptions) *runtime.Pager[MonitoringConfigClientListResponse] { return runtime.NewPager(runtime.PagingHandler[MonitoringConfigClientListResponse]{ More: func(page MonitoringConfigClientListResponse) bool { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_nodes_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/nodes_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_nodes_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/nodes_client.go index a6681fc3e5fb..57cf2ee2cd66 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_nodes_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/nodes_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type NodesClient struct { } // NewNodesClient creates a new instance of NodesClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewNodesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NodesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,12 +56,12 @@ func NewNodesClient(subscriptionID string, credential azcore.TokenCredential, op } // NewListByDataBoxEdgeDevicePager - Gets all the nodes currently configured under this Data Box Edge device -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - NodesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the NodesClient.ListByDataBoxEdgeDevice -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - NodesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the NodesClient.NewListByDataBoxEdgeDevicePager +// method. func (client *NodesClient) NewListByDataBoxEdgeDevicePager(deviceName string, resourceGroupName string, options *NodesClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[NodesClientListByDataBoxEdgeDeviceResponse] { return runtime.NewPager(runtime.PagingHandler[NodesClientListByDataBoxEdgeDeviceResponse]{ More: func(page NodesClientListByDataBoxEdgeDeviceResponse) bool { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_operations_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/operations_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_operations_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/operations_client.go index 254180459581..d6e5a35e87cb 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_operations_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/operations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -27,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -49,9 +50,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - List all the supported operations. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_operationsstatus_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/operationsstatus_client.go similarity index 90% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_operationsstatus_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/operationsstatus_client.go index abb7c29faca0..982c0ad76319 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_operationsstatus_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/operationsstatus_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type OperationsStatusClient struct { } // NewOperationsStatusClient creates a new instance of OperationsStatusClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsStatusClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,12 @@ func NewOperationsStatusClient(subscriptionID string, credential azcore.TokenCre // Get - Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The job name. -// resourceGroupName - The resource group name. -// options - OperationsStatusClientGetOptions contains the optional parameters for the OperationsStatusClient.Get method. +// - deviceName - The device name. +// - name - The job name. +// - resourceGroupName - The resource group name. +// - options - OperationsStatusClientGetOptions contains the optional parameters for the OperationsStatusClient.Get method. func (client *OperationsStatusClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string, options *OperationsStatusClientGetOptions) (OperationsStatusClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, name, resourceGroupName, options) if err != nil { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_orders_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/orders_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_orders_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/orders_client.go index f56af875fe90..4bbcb77fbe9d 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_orders_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/orders_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type OrdersClient struct { } // NewOrdersClient creates a new instance of OrdersClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOrdersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OrdersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewOrdersClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Creates or updates an order. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The order details of a device. -// resourceGroupName - The resource group name. -// order - The order to be created or updated. -// options - OrdersClientBeginCreateOrUpdateOptions contains the optional parameters for the OrdersClient.BeginCreateOrUpdate -// method. +// - deviceName - The order details of a device. +// - resourceGroupName - The resource group name. +// - order - The order to be created or updated. +// - options - OrdersClientBeginCreateOrUpdateOptions contains the optional parameters for the OrdersClient.BeginCreateOrUpdate +// method. func (client *OrdersClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, resourceGroupName string, order Order, options *OrdersClientBeginCreateOrUpdateOptions) (*runtime.Poller[OrdersClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, deviceName, resourceGroupName, order, options) @@ -76,6 +78,7 @@ func (client *OrdersClient) BeginCreateOrUpdate(ctx context.Context, deviceName // CreateOrUpdate - Creates or updates an order. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *OrdersClient) createOrUpdate(ctx context.Context, deviceName string, resourceGroupName string, order Order, options *OrdersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, deviceName, resourceGroupName, order, options) @@ -120,10 +123,11 @@ func (client *OrdersClient) createOrUpdateCreateRequest(ctx context.Context, dev // BeginDelete - Deletes the order related to the device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - OrdersClientBeginDeleteOptions contains the optional parameters for the OrdersClient.BeginDelete method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - OrdersClientBeginDeleteOptions contains the optional parameters for the OrdersClient.BeginDelete method. func (client *OrdersClient) BeginDelete(ctx context.Context, deviceName string, resourceGroupName string, options *OrdersClientBeginDeleteOptions) (*runtime.Poller[OrdersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, deviceName, resourceGroupName, options) @@ -138,6 +142,7 @@ func (client *OrdersClient) BeginDelete(ctx context.Context, deviceName string, // Delete - Deletes the order related to the device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *OrdersClient) deleteOperation(ctx context.Context, deviceName string, resourceGroupName string, options *OrdersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, deviceName, resourceGroupName, options) @@ -182,10 +187,11 @@ func (client *OrdersClient) deleteCreateRequest(ctx context.Context, deviceName // Get - Gets a specific order by name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - OrdersClientGetOptions contains the optional parameters for the OrdersClient.Get method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - OrdersClientGetOptions contains the optional parameters for the OrdersClient.Get method. func (client *OrdersClient) Get(ctx context.Context, deviceName string, resourceGroupName string, options *OrdersClientGetOptions) (OrdersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, resourceGroupName, options) if err != nil { @@ -237,12 +243,12 @@ func (client *OrdersClient) getHandleResponse(resp *http.Response) (OrdersClient } // NewListByDataBoxEdgeDevicePager - Lists all the orders related to a Data Box Edge/Data Box Gateway device. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - OrdersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the OrdersClient.ListByDataBoxEdgeDevice -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - OrdersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the OrdersClient.NewListByDataBoxEdgeDevicePager +// method. func (client *OrdersClient) NewListByDataBoxEdgeDevicePager(deviceName string, resourceGroupName string, options *OrdersClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[OrdersClientListByDataBoxEdgeDeviceResponse] { return runtime.NewPager(runtime.PagingHandler[OrdersClientListByDataBoxEdgeDeviceResponse]{ More: func(page OrdersClientListByDataBoxEdgeDeviceResponse) bool { @@ -308,10 +314,11 @@ func (client *OrdersClient) listByDataBoxEdgeDeviceHandleResponse(resp *http.Res // ListDCAccessCode - Gets the DCAccess Code // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name -// resourceGroupName - The resource group name. -// options - OrdersClientListDCAccessCodeOptions contains the optional parameters for the OrdersClient.ListDCAccessCode method. +// - deviceName - The device name +// - resourceGroupName - The resource group name. +// - options - OrdersClientListDCAccessCodeOptions contains the optional parameters for the OrdersClient.ListDCAccessCode method. func (client *OrdersClient) ListDCAccessCode(ctx context.Context, deviceName string, resourceGroupName string, options *OrdersClientListDCAccessCodeOptions) (OrdersClientListDCAccessCodeResponse, error) { req, err := client.listDCAccessCodeCreateRequest(ctx, deviceName, resourceGroupName, options) if err != nil { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/databoxedge/armdataboxedge/polymorphic_helpers.go similarity index 97% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_polymorphic_helpers.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/polymorphic_helpers.go index 50b8b424a5b0..41e72fa2c605 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/polymorphic_helpers.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -14,7 +15,7 @@ func unmarshalAddonClassification(rawMsg json.RawMessage) (AddonClassification, if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -53,7 +54,7 @@ func unmarshalRoleClassification(rawMsg json.RawMessage) (RoleClassification, er if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -96,7 +97,7 @@ func unmarshalTriggerClassification(rawMsg json.RawMessage) (TriggerClassificati if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_response_types.go b/sdk/resourcemanager/databoxedge/armdataboxedge/response_types.go similarity index 85% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_response_types.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/response_types.go index ad75a7f87a27..cacd1e5c5555 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_response_types.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/response_types.go @@ -5,10 +5,11 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge -// AddonsClientCreateOrUpdateResponse contains the response from method AddonsClient.CreateOrUpdate. +// AddonsClientCreateOrUpdateResponse contains the response from method AddonsClient.BeginCreateOrUpdate. type AddonsClientCreateOrUpdateResponse struct { AddonClassification } @@ -23,7 +24,7 @@ func (a *AddonsClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { return nil } -// AddonsClientDeleteResponse contains the response from method AddonsClient.Delete. +// AddonsClientDeleteResponse contains the response from method AddonsClient.BeginDelete. type AddonsClientDeleteResponse struct { // placeholder for future response values } @@ -43,7 +44,7 @@ func (a *AddonsClientGetResponse) UnmarshalJSON(data []byte) error { return nil } -// AddonsClientListByRoleResponse contains the response from method AddonsClient.ListByRole. +// AddonsClientListByRoleResponse contains the response from method AddonsClient.NewListByRolePager. type AddonsClientListByRoleResponse struct { AddonList } @@ -53,22 +54,22 @@ type AlertsClientGetResponse struct { Alert } -// AlertsClientListByDataBoxEdgeDeviceResponse contains the response from method AlertsClient.ListByDataBoxEdgeDevice. +// AlertsClientListByDataBoxEdgeDeviceResponse contains the response from method AlertsClient.NewListByDataBoxEdgeDevicePager. type AlertsClientListByDataBoxEdgeDeviceResponse struct { AlertList } -// AvailableSKUsClientListResponse contains the response from method AvailableSKUsClient.List. +// AvailableSKUsClientListResponse contains the response from method AvailableSKUsClient.NewListPager. type AvailableSKUsClientListResponse struct { SKUList } -// BandwidthSchedulesClientCreateOrUpdateResponse contains the response from method BandwidthSchedulesClient.CreateOrUpdate. +// BandwidthSchedulesClientCreateOrUpdateResponse contains the response from method BandwidthSchedulesClient.BeginCreateOrUpdate. type BandwidthSchedulesClientCreateOrUpdateResponse struct { BandwidthSchedule } -// BandwidthSchedulesClientDeleteResponse contains the response from method BandwidthSchedulesClient.Delete. +// BandwidthSchedulesClientDeleteResponse contains the response from method BandwidthSchedulesClient.BeginDelete. type BandwidthSchedulesClientDeleteResponse struct { // placeholder for future response values } @@ -78,17 +79,17 @@ type BandwidthSchedulesClientGetResponse struct { BandwidthSchedule } -// BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse contains the response from method BandwidthSchedulesClient.ListByDataBoxEdgeDevice. +// BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse contains the response from method BandwidthSchedulesClient.NewListByDataBoxEdgeDevicePager. type BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse struct { BandwidthSchedulesList } -// ContainersClientCreateOrUpdateResponse contains the response from method ContainersClient.CreateOrUpdate. +// ContainersClientCreateOrUpdateResponse contains the response from method ContainersClient.BeginCreateOrUpdate. type ContainersClientCreateOrUpdateResponse struct { Container } -// ContainersClientDeleteResponse contains the response from method ContainersClient.Delete. +// ContainersClientDeleteResponse contains the response from method ContainersClient.BeginDelete. type ContainersClientDeleteResponse struct { // placeholder for future response values } @@ -98,17 +99,17 @@ type ContainersClientGetResponse struct { Container } -// ContainersClientListByStorageAccountResponse contains the response from method ContainersClient.ListByStorageAccount. +// ContainersClientListByStorageAccountResponse contains the response from method ContainersClient.NewListByStorageAccountPager. type ContainersClientListByStorageAccountResponse struct { ContainerList } -// ContainersClientRefreshResponse contains the response from method ContainersClient.Refresh. +// ContainersClientRefreshResponse contains the response from method ContainersClient.BeginRefresh. type ContainersClientRefreshResponse struct { // placeholder for future response values } -// DeviceCapacityCheckClientCheckResourceCreationFeasibilityResponse contains the response from method DeviceCapacityCheckClient.CheckResourceCreationFeasibility. +// DeviceCapacityCheckClientCheckResourceCreationFeasibilityResponse contains the response from method DeviceCapacityCheckClient.BeginCheckResourceCreationFeasibility. type DeviceCapacityCheckClientCheckResourceCreationFeasibilityResponse struct { // placeholder for future response values } @@ -123,17 +124,17 @@ type DevicesClientCreateOrUpdateResponse struct { Device } -// DevicesClientCreateOrUpdateSecuritySettingsResponse contains the response from method DevicesClient.CreateOrUpdateSecuritySettings. +// DevicesClientCreateOrUpdateSecuritySettingsResponse contains the response from method DevicesClient.BeginCreateOrUpdateSecuritySettings. type DevicesClientCreateOrUpdateSecuritySettingsResponse struct { // placeholder for future response values } -// DevicesClientDeleteResponse contains the response from method DevicesClient.Delete. +// DevicesClientDeleteResponse contains the response from method DevicesClient.BeginDelete. type DevicesClientDeleteResponse struct { // placeholder for future response values } -// DevicesClientDownloadUpdatesResponse contains the response from method DevicesClient.DownloadUpdates. +// DevicesClientDownloadUpdatesResponse contains the response from method DevicesClient.BeginDownloadUpdates. type DevicesClientDownloadUpdatesResponse struct { // placeholder for future response values } @@ -163,22 +164,22 @@ type DevicesClientGetUpdateSummaryResponse struct { UpdateSummary } -// DevicesClientInstallUpdatesResponse contains the response from method DevicesClient.InstallUpdates. +// DevicesClientInstallUpdatesResponse contains the response from method DevicesClient.BeginInstallUpdates. type DevicesClientInstallUpdatesResponse struct { // placeholder for future response values } -// DevicesClientListByResourceGroupResponse contains the response from method DevicesClient.ListByResourceGroup. +// DevicesClientListByResourceGroupResponse contains the response from method DevicesClient.NewListByResourceGroupPager. type DevicesClientListByResourceGroupResponse struct { DeviceList } -// DevicesClientListBySubscriptionResponse contains the response from method DevicesClient.ListBySubscription. +// DevicesClientListBySubscriptionResponse contains the response from method DevicesClient.NewListBySubscriptionPager. type DevicesClientListBySubscriptionResponse struct { DeviceList } -// DevicesClientScanForUpdatesResponse contains the response from method DevicesClient.ScanForUpdates. +// DevicesClientScanForUpdatesResponse contains the response from method DevicesClient.BeginScanForUpdates. type DevicesClientScanForUpdatesResponse struct { // placeholder for future response values } @@ -208,12 +209,12 @@ type DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResponse struct { DiagnosticRemoteSupportSettings } -// DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse contains the response from method DiagnosticSettingsClient.UpdateDiagnosticProactiveLogCollectionSettings. +// DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse contains the response from method DiagnosticSettingsClient.BeginUpdateDiagnosticProactiveLogCollectionSettings. type DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse struct { DiagnosticProactiveLogCollectionSettings } -// DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse contains the response from method DiagnosticSettingsClient.UpdateDiagnosticRemoteSupportSettings. +// DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse contains the response from method DiagnosticSettingsClient.BeginUpdateDiagnosticRemoteSupportSettings. type DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse struct { DiagnosticRemoteSupportSettings } @@ -223,12 +224,12 @@ type JobsClientGetResponse struct { Job } -// MonitoringConfigClientCreateOrUpdateResponse contains the response from method MonitoringConfigClient.CreateOrUpdate. +// MonitoringConfigClientCreateOrUpdateResponse contains the response from method MonitoringConfigClient.BeginCreateOrUpdate. type MonitoringConfigClientCreateOrUpdateResponse struct { MonitoringMetricConfiguration } -// MonitoringConfigClientDeleteResponse contains the response from method MonitoringConfigClient.Delete. +// MonitoringConfigClientDeleteResponse contains the response from method MonitoringConfigClient.BeginDelete. type MonitoringConfigClientDeleteResponse struct { // placeholder for future response values } @@ -238,17 +239,17 @@ type MonitoringConfigClientGetResponse struct { MonitoringMetricConfiguration } -// MonitoringConfigClientListResponse contains the response from method MonitoringConfigClient.List. +// MonitoringConfigClientListResponse contains the response from method MonitoringConfigClient.NewListPager. type MonitoringConfigClientListResponse struct { MonitoringMetricConfigurationList } -// NodesClientListByDataBoxEdgeDeviceResponse contains the response from method NodesClient.ListByDataBoxEdgeDevice. +// NodesClientListByDataBoxEdgeDeviceResponse contains the response from method NodesClient.NewListByDataBoxEdgeDevicePager. type NodesClientListByDataBoxEdgeDeviceResponse struct { NodeList } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationsList } @@ -258,12 +259,12 @@ type OperationsStatusClientGetResponse struct { Job } -// OrdersClientCreateOrUpdateResponse contains the response from method OrdersClient.CreateOrUpdate. +// OrdersClientCreateOrUpdateResponse contains the response from method OrdersClient.BeginCreateOrUpdate. type OrdersClientCreateOrUpdateResponse struct { Order } -// OrdersClientDeleteResponse contains the response from method OrdersClient.Delete. +// OrdersClientDeleteResponse contains the response from method OrdersClient.BeginDelete. type OrdersClientDeleteResponse struct { // placeholder for future response values } @@ -273,7 +274,7 @@ type OrdersClientGetResponse struct { Order } -// OrdersClientListByDataBoxEdgeDeviceResponse contains the response from method OrdersClient.ListByDataBoxEdgeDevice. +// OrdersClientListByDataBoxEdgeDeviceResponse contains the response from method OrdersClient.NewListByDataBoxEdgeDevicePager. type OrdersClientListByDataBoxEdgeDeviceResponse struct { OrderList } @@ -283,7 +284,7 @@ type OrdersClientListDCAccessCodeResponse struct { DCAccessCode } -// RolesClientCreateOrUpdateResponse contains the response from method RolesClient.CreateOrUpdate. +// RolesClientCreateOrUpdateResponse contains the response from method RolesClient.BeginCreateOrUpdate. type RolesClientCreateOrUpdateResponse struct { RoleClassification } @@ -298,7 +299,7 @@ func (r *RolesClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { return nil } -// RolesClientDeleteResponse contains the response from method RolesClient.Delete. +// RolesClientDeleteResponse contains the response from method RolesClient.BeginDelete. type RolesClientDeleteResponse struct { // placeholder for future response values } @@ -318,17 +319,17 @@ func (r *RolesClientGetResponse) UnmarshalJSON(data []byte) error { return nil } -// RolesClientListByDataBoxEdgeDeviceResponse contains the response from method RolesClient.ListByDataBoxEdgeDevice. +// RolesClientListByDataBoxEdgeDeviceResponse contains the response from method RolesClient.NewListByDataBoxEdgeDevicePager. type RolesClientListByDataBoxEdgeDeviceResponse struct { RoleList } -// SharesClientCreateOrUpdateResponse contains the response from method SharesClient.CreateOrUpdate. +// SharesClientCreateOrUpdateResponse contains the response from method SharesClient.BeginCreateOrUpdate. type SharesClientCreateOrUpdateResponse struct { Share } -// SharesClientDeleteResponse contains the response from method SharesClient.Delete. +// SharesClientDeleteResponse contains the response from method SharesClient.BeginDelete. type SharesClientDeleteResponse struct { // placeholder for future response values } @@ -338,22 +339,22 @@ type SharesClientGetResponse struct { Share } -// SharesClientListByDataBoxEdgeDeviceResponse contains the response from method SharesClient.ListByDataBoxEdgeDevice. +// SharesClientListByDataBoxEdgeDeviceResponse contains the response from method SharesClient.NewListByDataBoxEdgeDevicePager. type SharesClientListByDataBoxEdgeDeviceResponse struct { ShareList } -// SharesClientRefreshResponse contains the response from method SharesClient.Refresh. +// SharesClientRefreshResponse contains the response from method SharesClient.BeginRefresh. type SharesClientRefreshResponse struct { // placeholder for future response values } -// StorageAccountCredentialsClientCreateOrUpdateResponse contains the response from method StorageAccountCredentialsClient.CreateOrUpdate. +// StorageAccountCredentialsClientCreateOrUpdateResponse contains the response from method StorageAccountCredentialsClient.BeginCreateOrUpdate. type StorageAccountCredentialsClientCreateOrUpdateResponse struct { StorageAccountCredential } -// StorageAccountCredentialsClientDeleteResponse contains the response from method StorageAccountCredentialsClient.Delete. +// StorageAccountCredentialsClientDeleteResponse contains the response from method StorageAccountCredentialsClient.BeginDelete. type StorageAccountCredentialsClientDeleteResponse struct { // placeholder for future response values } @@ -363,17 +364,17 @@ type StorageAccountCredentialsClientGetResponse struct { StorageAccountCredential } -// StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse contains the response from method StorageAccountCredentialsClient.ListByDataBoxEdgeDevice. +// StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse contains the response from method StorageAccountCredentialsClient.NewListByDataBoxEdgeDevicePager. type StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse struct { StorageAccountCredentialList } -// StorageAccountsClientCreateOrUpdateResponse contains the response from method StorageAccountsClient.CreateOrUpdate. +// StorageAccountsClientCreateOrUpdateResponse contains the response from method StorageAccountsClient.BeginCreateOrUpdate. type StorageAccountsClientCreateOrUpdateResponse struct { StorageAccount } -// StorageAccountsClientDeleteResponse contains the response from method StorageAccountsClient.Delete. +// StorageAccountsClientDeleteResponse contains the response from method StorageAccountsClient.BeginDelete. type StorageAccountsClientDeleteResponse struct { // placeholder for future response values } @@ -383,17 +384,17 @@ type StorageAccountsClientGetResponse struct { StorageAccount } -// StorageAccountsClientListByDataBoxEdgeDeviceResponse contains the response from method StorageAccountsClient.ListByDataBoxEdgeDevice. +// StorageAccountsClientListByDataBoxEdgeDeviceResponse contains the response from method StorageAccountsClient.NewListByDataBoxEdgeDevicePager. type StorageAccountsClientListByDataBoxEdgeDeviceResponse struct { StorageAccountList } -// SupportPackagesClientTriggerSupportPackageResponse contains the response from method SupportPackagesClient.TriggerSupportPackage. +// SupportPackagesClientTriggerSupportPackageResponse contains the response from method SupportPackagesClient.BeginTriggerSupportPackage. type SupportPackagesClientTriggerSupportPackageResponse struct { // placeholder for future response values } -// TriggersClientCreateOrUpdateResponse contains the response from method TriggersClient.CreateOrUpdate. +// TriggersClientCreateOrUpdateResponse contains the response from method TriggersClient.BeginCreateOrUpdate. type TriggersClientCreateOrUpdateResponse struct { TriggerClassification } @@ -408,7 +409,7 @@ func (t *TriggersClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error return nil } -// TriggersClientDeleteResponse contains the response from method TriggersClient.Delete. +// TriggersClientDeleteResponse contains the response from method TriggersClient.BeginDelete. type TriggersClientDeleteResponse struct { // placeholder for future response values } @@ -428,17 +429,17 @@ func (t *TriggersClientGetResponse) UnmarshalJSON(data []byte) error { return nil } -// TriggersClientListByDataBoxEdgeDeviceResponse contains the response from method TriggersClient.ListByDataBoxEdgeDevice. +// TriggersClientListByDataBoxEdgeDeviceResponse contains the response from method TriggersClient.NewListByDataBoxEdgeDevicePager. type TriggersClientListByDataBoxEdgeDeviceResponse struct { TriggerList } -// UsersClientCreateOrUpdateResponse contains the response from method UsersClient.CreateOrUpdate. +// UsersClientCreateOrUpdateResponse contains the response from method UsersClient.BeginCreateOrUpdate. type UsersClientCreateOrUpdateResponse struct { User } -// UsersClientDeleteResponse contains the response from method UsersClient.Delete. +// UsersClientDeleteResponse contains the response from method UsersClient.BeginDelete. type UsersClientDeleteResponse struct { // placeholder for future response values } @@ -448,7 +449,7 @@ type UsersClientGetResponse struct { User } -// UsersClientListByDataBoxEdgeDeviceResponse contains the response from method UsersClient.ListByDataBoxEdgeDevice. +// UsersClientListByDataBoxEdgeDeviceResponse contains the response from method UsersClient.NewListByDataBoxEdgeDevicePager. type UsersClientListByDataBoxEdgeDeviceResponse struct { UserList } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_roles_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/roles_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_roles_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/roles_client.go index ee955e5468aa..e64405538248 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_roles_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/roles_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type RolesClient struct { } // NewRolesClient creates a new instance of RolesClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRolesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RolesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewRolesClient(subscriptionID string, credential azcore.TokenCredential, op // BeginCreateOrUpdate - Create or update a role. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The role name. -// resourceGroupName - The resource group name. -// role - The role properties. -// options - RolesClientBeginCreateOrUpdateOptions contains the optional parameters for the RolesClient.BeginCreateOrUpdate -// method. +// - deviceName - The device name. +// - name - The role name. +// - resourceGroupName - The resource group name. +// - role - The role properties. +// - options - RolesClientBeginCreateOrUpdateOptions contains the optional parameters for the RolesClient.BeginCreateOrUpdate +// method. func (client *RolesClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, role RoleClassification, options *RolesClientBeginCreateOrUpdateOptions) (*runtime.Poller[RolesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, role, options) @@ -77,6 +79,7 @@ func (client *RolesClient) BeginCreateOrUpdate(ctx context.Context, deviceName s // CreateOrUpdate - Create or update a role. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *RolesClient) createOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, role RoleClassification, options *RolesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, deviceName, name, resourceGroupName, role, options) @@ -125,11 +128,12 @@ func (client *RolesClient) createOrUpdateCreateRequest(ctx context.Context, devi // BeginDelete - Deletes the role on the device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The role name. -// resourceGroupName - The resource group name. -// options - RolesClientBeginDeleteOptions contains the optional parameters for the RolesClient.BeginDelete method. +// - deviceName - The device name. +// - name - The role name. +// - resourceGroupName - The resource group name. +// - options - RolesClientBeginDeleteOptions contains the optional parameters for the RolesClient.BeginDelete method. func (client *RolesClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *RolesClientBeginDeleteOptions) (*runtime.Poller[RolesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) @@ -144,6 +148,7 @@ func (client *RolesClient) BeginDelete(ctx context.Context, deviceName string, n // Delete - Deletes the role on the device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *RolesClient) deleteOperation(ctx context.Context, deviceName string, name string, resourceGroupName string, options *RolesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, deviceName, name, resourceGroupName, options) @@ -192,11 +197,12 @@ func (client *RolesClient) deleteCreateRequest(ctx context.Context, deviceName s // Get - Gets a specific role by name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The role name. -// resourceGroupName - The resource group name. -// options - RolesClientGetOptions contains the optional parameters for the RolesClient.Get method. +// - deviceName - The device name. +// - name - The role name. +// - resourceGroupName - The resource group name. +// - options - RolesClientGetOptions contains the optional parameters for the RolesClient.Get method. func (client *RolesClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string, options *RolesClientGetOptions) (RolesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, name, resourceGroupName, options) if err != nil { @@ -252,12 +258,12 @@ func (client *RolesClient) getHandleResponse(resp *http.Response) (RolesClientGe } // NewListByDataBoxEdgeDevicePager - Lists all the roles configured in a Data Box Edge/Data Box Gateway device. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - RolesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the RolesClient.ListByDataBoxEdgeDevice -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - RolesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the RolesClient.NewListByDataBoxEdgeDevicePager +// method. func (client *RolesClient) NewListByDataBoxEdgeDevicePager(deviceName string, resourceGroupName string, options *RolesClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[RolesClientListByDataBoxEdgeDeviceResponse] { return runtime.NewPager(runtime.PagingHandler[RolesClientListByDataBoxEdgeDeviceResponse]{ More: func(page RolesClientListByDataBoxEdgeDeviceResponse) bool { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_shares_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/shares_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_shares_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/shares_client.go index ee5dfb5f096a..b144ab2423bd 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_shares_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/shares_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type SharesClient struct { } // NewSharesClient creates a new instance of SharesClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSharesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewSharesClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Creates a new share or updates an existing share on the device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The share name. -// resourceGroupName - The resource group name. -// share - The share properties. -// options - SharesClientBeginCreateOrUpdateOptions contains the optional parameters for the SharesClient.BeginCreateOrUpdate -// method. +// - deviceName - The device name. +// - name - The share name. +// - resourceGroupName - The resource group name. +// - share - The share properties. +// - options - SharesClientBeginCreateOrUpdateOptions contains the optional parameters for the SharesClient.BeginCreateOrUpdate +// method. func (client *SharesClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, share Share, options *SharesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SharesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, share, options) @@ -77,6 +79,7 @@ func (client *SharesClient) BeginCreateOrUpdate(ctx context.Context, deviceName // CreateOrUpdate - Creates a new share or updates an existing share on the device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *SharesClient) createOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, share Share, options *SharesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, deviceName, name, resourceGroupName, share, options) @@ -125,11 +128,12 @@ func (client *SharesClient) createOrUpdateCreateRequest(ctx context.Context, dev // BeginDelete - Deletes the share on the Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The share name. -// resourceGroupName - The resource group name. -// options - SharesClientBeginDeleteOptions contains the optional parameters for the SharesClient.BeginDelete method. +// - deviceName - The device name. +// - name - The share name. +// - resourceGroupName - The resource group name. +// - options - SharesClientBeginDeleteOptions contains the optional parameters for the SharesClient.BeginDelete method. func (client *SharesClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *SharesClientBeginDeleteOptions) (*runtime.Poller[SharesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) @@ -144,6 +148,7 @@ func (client *SharesClient) BeginDelete(ctx context.Context, deviceName string, // Delete - Deletes the share on the Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *SharesClient) deleteOperation(ctx context.Context, deviceName string, name string, resourceGroupName string, options *SharesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, deviceName, name, resourceGroupName, options) @@ -192,11 +197,12 @@ func (client *SharesClient) deleteCreateRequest(ctx context.Context, deviceName // Get - Gets a share by name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The share name. -// resourceGroupName - The resource group name. -// options - SharesClientGetOptions contains the optional parameters for the SharesClient.Get method. +// - deviceName - The device name. +// - name - The share name. +// - resourceGroupName - The resource group name. +// - options - SharesClientGetOptions contains the optional parameters for the SharesClient.Get method. func (client *SharesClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string, options *SharesClientGetOptions) (SharesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, name, resourceGroupName, options) if err != nil { @@ -252,12 +258,12 @@ func (client *SharesClient) getHandleResponse(resp *http.Response) (SharesClient } // NewListByDataBoxEdgeDevicePager - Lists all the shares in a Data Box Edge/Data Box Gateway device. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - SharesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the SharesClient.ListByDataBoxEdgeDevice -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - SharesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the SharesClient.NewListByDataBoxEdgeDevicePager +// method. func (client *SharesClient) NewListByDataBoxEdgeDevicePager(deviceName string, resourceGroupName string, options *SharesClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[SharesClientListByDataBoxEdgeDeviceResponse] { return runtime.NewPager(runtime.PagingHandler[SharesClientListByDataBoxEdgeDeviceResponse]{ More: func(page SharesClientListByDataBoxEdgeDeviceResponse) bool { @@ -323,11 +329,12 @@ func (client *SharesClient) listByDataBoxEdgeDeviceHandleResponse(resp *http.Res // BeginRefresh - Refreshes the share metadata with the data from the cloud. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The share name. -// resourceGroupName - The resource group name. -// options - SharesClientBeginRefreshOptions contains the optional parameters for the SharesClient.BeginRefresh method. +// - deviceName - The device name. +// - name - The share name. +// - resourceGroupName - The resource group name. +// - options - SharesClientBeginRefreshOptions contains the optional parameters for the SharesClient.BeginRefresh method. func (client *SharesClient) BeginRefresh(ctx context.Context, deviceName string, name string, resourceGroupName string, options *SharesClientBeginRefreshOptions) (*runtime.Poller[SharesClientRefreshResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.refresh(ctx, deviceName, name, resourceGroupName, options) @@ -342,6 +349,7 @@ func (client *SharesClient) BeginRefresh(ctx context.Context, deviceName string, // Refresh - Refreshes the share metadata with the data from the cloud. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *SharesClient) refresh(ctx context.Context, deviceName string, name string, resourceGroupName string, options *SharesClientBeginRefreshOptions) (*http.Response, error) { req, err := client.refreshCreateRequest(ctx, deviceName, name, resourceGroupName, options) diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_storageaccountcredentials_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/storageaccountcredentials_client.go similarity index 90% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_storageaccountcredentials_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/storageaccountcredentials_client.go index e4ce475d25a9..2b28d06b9ff4 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_storageaccountcredentials_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/storageaccountcredentials_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type StorageAccountCredentialsClient struct { } // NewStorageAccountCredentialsClient creates a new instance of StorageAccountCredentialsClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewStorageAccountCredentialsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StorageAccountCredentialsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewStorageAccountCredentialsClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Creates or updates the storage account credential. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The storage account credential name. -// resourceGroupName - The resource group name. -// storageAccountCredential - The storage account credential. -// options - StorageAccountCredentialsClientBeginCreateOrUpdateOptions contains the optional parameters for the StorageAccountCredentialsClient.BeginCreateOrUpdate -// method. +// - deviceName - The device name. +// - name - The storage account credential name. +// - resourceGroupName - The resource group name. +// - storageAccountCredential - The storage account credential. +// - options - StorageAccountCredentialsClientBeginCreateOrUpdateOptions contains the optional parameters for the StorageAccountCredentialsClient.BeginCreateOrUpdate +// method. func (client *StorageAccountCredentialsClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, storageAccountCredential StorageAccountCredential, options *StorageAccountCredentialsClientBeginCreateOrUpdateOptions) (*runtime.Poller[StorageAccountCredentialsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, storageAccountCredential, options) @@ -77,6 +79,7 @@ func (client *StorageAccountCredentialsClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Creates or updates the storage account credential. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *StorageAccountCredentialsClient) createOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, storageAccountCredential StorageAccountCredential, options *StorageAccountCredentialsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, deviceName, name, resourceGroupName, storageAccountCredential, options) @@ -125,12 +128,13 @@ func (client *StorageAccountCredentialsClient) createOrUpdateCreateRequest(ctx c // BeginDelete - Deletes the storage account credential. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The storage account credential name. -// resourceGroupName - The resource group name. -// options - StorageAccountCredentialsClientBeginDeleteOptions contains the optional parameters for the StorageAccountCredentialsClient.BeginDelete -// method. +// - deviceName - The device name. +// - name - The storage account credential name. +// - resourceGroupName - The resource group name. +// - options - StorageAccountCredentialsClientBeginDeleteOptions contains the optional parameters for the StorageAccountCredentialsClient.BeginDelete +// method. func (client *StorageAccountCredentialsClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *StorageAccountCredentialsClientBeginDeleteOptions) (*runtime.Poller[StorageAccountCredentialsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) @@ -145,6 +149,7 @@ func (client *StorageAccountCredentialsClient) BeginDelete(ctx context.Context, // Delete - Deletes the storage account credential. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *StorageAccountCredentialsClient) deleteOperation(ctx context.Context, deviceName string, name string, resourceGroupName string, options *StorageAccountCredentialsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, deviceName, name, resourceGroupName, options) @@ -193,12 +198,13 @@ func (client *StorageAccountCredentialsClient) deleteCreateRequest(ctx context.C // Get - Gets the properties of the specified storage account credential. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The storage account credential name. -// resourceGroupName - The resource group name. -// options - StorageAccountCredentialsClientGetOptions contains the optional parameters for the StorageAccountCredentialsClient.Get -// method. +// - deviceName - The device name. +// - name - The storage account credential name. +// - resourceGroupName - The resource group name. +// - options - StorageAccountCredentialsClientGetOptions contains the optional parameters for the StorageAccountCredentialsClient.Get +// method. func (client *StorageAccountCredentialsClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string, options *StorageAccountCredentialsClientGetOptions) (StorageAccountCredentialsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, name, resourceGroupName, options) if err != nil { @@ -254,12 +260,12 @@ func (client *StorageAccountCredentialsClient) getHandleResponse(resp *http.Resp } // NewListByDataBoxEdgeDevicePager - Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - StorageAccountCredentialsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the StorageAccountCredentialsClient.ListByDataBoxEdgeDevice -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - StorageAccountCredentialsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the StorageAccountCredentialsClient.NewListByDataBoxEdgeDevicePager +// method. func (client *StorageAccountCredentialsClient) NewListByDataBoxEdgeDevicePager(deviceName string, resourceGroupName string, options *StorageAccountCredentialsClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse] { return runtime.NewPager(runtime.PagingHandler[StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse]{ More: func(page StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse) bool { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_storageaccounts_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/storageaccounts_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_storageaccounts_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/storageaccounts_client.go index e0cc5be49d15..d631316d48e1 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_storageaccounts_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/storageaccounts_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type StorageAccountsClient struct { } // NewStorageAccountsClient creates a new instance of StorageAccountsClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewStorageAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StorageAccountsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewStorageAccountsClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Creates a new StorageAccount or updates an existing StorageAccount on the device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// storageAccountName - The StorageAccount name. -// resourceGroupName - The resource group name. -// storageAccount - The StorageAccount properties. -// options - StorageAccountsClientBeginCreateOrUpdateOptions contains the optional parameters for the StorageAccountsClient.BeginCreateOrUpdate -// method. +// - deviceName - The device name. +// - storageAccountName - The StorageAccount name. +// - resourceGroupName - The resource group name. +// - storageAccount - The StorageAccount properties. +// - options - StorageAccountsClientBeginCreateOrUpdateOptions contains the optional parameters for the StorageAccountsClient.BeginCreateOrUpdate +// method. func (client *StorageAccountsClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string, storageAccount StorageAccount, options *StorageAccountsClientBeginCreateOrUpdateOptions) (*runtime.Poller[StorageAccountsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, deviceName, storageAccountName, resourceGroupName, storageAccount, options) @@ -77,6 +79,7 @@ func (client *StorageAccountsClient) BeginCreateOrUpdate(ctx context.Context, de // CreateOrUpdate - Creates a new StorageAccount or updates an existing StorageAccount on the device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *StorageAccountsClient) createOrUpdate(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string, storageAccount StorageAccount, options *StorageAccountsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, deviceName, storageAccountName, resourceGroupName, storageAccount, options) @@ -125,12 +128,13 @@ func (client *StorageAccountsClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// storageAccountName - The StorageAccount name. -// resourceGroupName - The resource group name. -// options - StorageAccountsClientBeginDeleteOptions contains the optional parameters for the StorageAccountsClient.BeginDelete -// method. +// - deviceName - The device name. +// - storageAccountName - The StorageAccount name. +// - resourceGroupName - The resource group name. +// - options - StorageAccountsClientBeginDeleteOptions contains the optional parameters for the StorageAccountsClient.BeginDelete +// method. func (client *StorageAccountsClient) BeginDelete(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string, options *StorageAccountsClientBeginDeleteOptions) (*runtime.Poller[StorageAccountsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, deviceName, storageAccountName, resourceGroupName, options) @@ -145,6 +149,7 @@ func (client *StorageAccountsClient) BeginDelete(ctx context.Context, deviceName // Delete - Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *StorageAccountsClient) deleteOperation(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string, options *StorageAccountsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, deviceName, storageAccountName, resourceGroupName, options) @@ -193,11 +198,12 @@ func (client *StorageAccountsClient) deleteCreateRequest(ctx context.Context, de // Get - Gets a StorageAccount by name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// storageAccountName - The storage account name. -// resourceGroupName - The resource group name. -// options - StorageAccountsClientGetOptions contains the optional parameters for the StorageAccountsClient.Get method. +// - deviceName - The device name. +// - storageAccountName - The storage account name. +// - resourceGroupName - The resource group name. +// - options - StorageAccountsClientGetOptions contains the optional parameters for the StorageAccountsClient.Get method. func (client *StorageAccountsClient) Get(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string, options *StorageAccountsClientGetOptions) (StorageAccountsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, storageAccountName, resourceGroupName, options) if err != nil { @@ -253,12 +259,12 @@ func (client *StorageAccountsClient) getHandleResponse(resp *http.Response) (Sto } // NewListByDataBoxEdgeDevicePager - Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - StorageAccountsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the StorageAccountsClient.ListByDataBoxEdgeDevice -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - StorageAccountsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the StorageAccountsClient.NewListByDataBoxEdgeDevicePager +// method. func (client *StorageAccountsClient) NewListByDataBoxEdgeDevicePager(deviceName string, resourceGroupName string, options *StorageAccountsClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[StorageAccountsClientListByDataBoxEdgeDeviceResponse] { return runtime.NewPager(runtime.PagingHandler[StorageAccountsClientListByDataBoxEdgeDeviceResponse]{ More: func(page StorageAccountsClientListByDataBoxEdgeDeviceResponse) bool { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_supportpackages_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/supportpackages_client.go similarity index 90% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_supportpackages_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/supportpackages_client.go index 1f4adddbe0e0..097755dd8357 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_supportpackages_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/supportpackages_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type SupportPackagesClient struct { } // NewSupportPackagesClient creates a new instance of SupportPackagesClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSupportPackagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SupportPackagesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewSupportPackagesClient(subscriptionID string, credential azcore.TokenCred // BeginTriggerSupportPackage - Triggers support package on the device // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// triggerSupportPackageRequest - The trigger support package request object -// options - SupportPackagesClientBeginTriggerSupportPackageOptions contains the optional parameters for the SupportPackagesClient.BeginTriggerSupportPackage -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - triggerSupportPackageRequest - The trigger support package request object +// - options - SupportPackagesClientBeginTriggerSupportPackageOptions contains the optional parameters for the SupportPackagesClient.BeginTriggerSupportPackage +// method. func (client *SupportPackagesClient) BeginTriggerSupportPackage(ctx context.Context, deviceName string, resourceGroupName string, triggerSupportPackageRequest TriggerSupportPackageRequest, options *SupportPackagesClientBeginTriggerSupportPackageOptions) (*runtime.Poller[SupportPackagesClientTriggerSupportPackageResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.triggerSupportPackage(ctx, deviceName, resourceGroupName, triggerSupportPackageRequest, options) @@ -76,6 +78,7 @@ func (client *SupportPackagesClient) BeginTriggerSupportPackage(ctx context.Cont // TriggerSupportPackage - Triggers support package on the device // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *SupportPackagesClient) triggerSupportPackage(ctx context.Context, deviceName string, resourceGroupName string, triggerSupportPackageRequest TriggerSupportPackageRequest, options *SupportPackagesClientBeginTriggerSupportPackageOptions) (*http.Response, error) { req, err := client.triggerSupportPackageCreateRequest(ctx, deviceName, resourceGroupName, triggerSupportPackageRequest, options) diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_time_rfc3339.go b/sdk/resourcemanager/databoxedge/armdataboxedge/time_rfc3339.go similarity index 96% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/time_rfc3339.go index 947ffe6c6dfc..8550e545bd03 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/time_rfc3339.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -61,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_triggers_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/triggers_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_triggers_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/triggers_client.go index 05501d2c2575..33c8c8027e8a 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_triggers_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/triggers_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type TriggersClient struct { } // NewTriggersClient creates a new instance of TriggersClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTriggersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TriggersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewTriggersClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Creates or updates a trigger. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - Creates or updates a trigger -// name - The trigger name. -// resourceGroupName - The resource group name. -// trigger - The trigger. -// options - TriggersClientBeginCreateOrUpdateOptions contains the optional parameters for the TriggersClient.BeginCreateOrUpdate -// method. +// - deviceName - Creates or updates a trigger +// - name - The trigger name. +// - resourceGroupName - The resource group name. +// - trigger - The trigger. +// - options - TriggersClientBeginCreateOrUpdateOptions contains the optional parameters for the TriggersClient.BeginCreateOrUpdate +// method. func (client *TriggersClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, trigger TriggerClassification, options *TriggersClientBeginCreateOrUpdateOptions) (*runtime.Poller[TriggersClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, trigger, options) @@ -77,6 +79,7 @@ func (client *TriggersClient) BeginCreateOrUpdate(ctx context.Context, deviceNam // CreateOrUpdate - Creates or updates a trigger. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *TriggersClient) createOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, trigger TriggerClassification, options *TriggersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, deviceName, name, resourceGroupName, trigger, options) @@ -125,11 +128,12 @@ func (client *TriggersClient) createOrUpdateCreateRequest(ctx context.Context, d // BeginDelete - Deletes the trigger on the gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The trigger name. -// resourceGroupName - The resource group name. -// options - TriggersClientBeginDeleteOptions contains the optional parameters for the TriggersClient.BeginDelete method. +// - deviceName - The device name. +// - name - The trigger name. +// - resourceGroupName - The resource group name. +// - options - TriggersClientBeginDeleteOptions contains the optional parameters for the TriggersClient.BeginDelete method. func (client *TriggersClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *TriggersClientBeginDeleteOptions) (*runtime.Poller[TriggersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) @@ -144,6 +148,7 @@ func (client *TriggersClient) BeginDelete(ctx context.Context, deviceName string // Delete - Deletes the trigger on the gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *TriggersClient) deleteOperation(ctx context.Context, deviceName string, name string, resourceGroupName string, options *TriggersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, deviceName, name, resourceGroupName, options) @@ -192,11 +197,12 @@ func (client *TriggersClient) deleteCreateRequest(ctx context.Context, deviceNam // Get - Get a specific trigger by name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The trigger name. -// resourceGroupName - The resource group name. -// options - TriggersClientGetOptions contains the optional parameters for the TriggersClient.Get method. +// - deviceName - The device name. +// - name - The trigger name. +// - resourceGroupName - The resource group name. +// - options - TriggersClientGetOptions contains the optional parameters for the TriggersClient.Get method. func (client *TriggersClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string, options *TriggersClientGetOptions) (TriggersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, name, resourceGroupName, options) if err != nil { @@ -252,12 +258,12 @@ func (client *TriggersClient) getHandleResponse(resp *http.Response) (TriggersCl } // NewListByDataBoxEdgeDevicePager - Lists all the triggers configured in the device. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - TriggersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the TriggersClient.ListByDataBoxEdgeDevice -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - TriggersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the TriggersClient.NewListByDataBoxEdgeDevicePager +// method. func (client *TriggersClient) NewListByDataBoxEdgeDevicePager(deviceName string, resourceGroupName string, options *TriggersClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[TriggersClientListByDataBoxEdgeDeviceResponse] { return runtime.NewPager(runtime.PagingHandler[TriggersClientListByDataBoxEdgeDeviceResponse]{ More: func(page TriggersClientListByDataBoxEdgeDeviceResponse) bool { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_users_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/users_client.go similarity index 91% rename from sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_users_client.go rename to sdk/resourcemanager/databoxedge/armdataboxedge/users_client.go index 242622af90cb..f484de4022a6 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_users_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/users_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armdataboxedge @@ -31,9 +32,9 @@ type UsersClient struct { } // NewUsersClient creates a new instance of UsersClient with the specified values. -// subscriptionID - The subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewUsersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +58,14 @@ func NewUsersClient(subscriptionID string, credential azcore.TokenCredential, op // BeginCreateOrUpdate - Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway // device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The user name. -// resourceGroupName - The resource group name. -// userParam - The user details. -// options - UsersClientBeginCreateOrUpdateOptions contains the optional parameters for the UsersClient.BeginCreateOrUpdate -// method. +// - deviceName - The device name. +// - name - The user name. +// - resourceGroupName - The resource group name. +// - userParam - The user details. +// - options - UsersClientBeginCreateOrUpdateOptions contains the optional parameters for the UsersClient.BeginCreateOrUpdate +// method. func (client *UsersClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, userParam User, options *UsersClientBeginCreateOrUpdateOptions) (*runtime.Poller[UsersClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, userParam, options) @@ -78,6 +80,7 @@ func (client *UsersClient) BeginCreateOrUpdate(ctx context.Context, deviceName s // CreateOrUpdate - Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *UsersClient) createOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, userParam User, options *UsersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, deviceName, name, resourceGroupName, userParam, options) @@ -126,11 +129,12 @@ func (client *UsersClient) createOrUpdateCreateRequest(ctx context.Context, devi // BeginDelete - Deletes the user on a databox edge/gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The user name. -// resourceGroupName - The resource group name. -// options - UsersClientBeginDeleteOptions contains the optional parameters for the UsersClient.BeginDelete method. +// - deviceName - The device name. +// - name - The user name. +// - resourceGroupName - The resource group name. +// - options - UsersClientBeginDeleteOptions contains the optional parameters for the UsersClient.BeginDelete method. func (client *UsersClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *UsersClientBeginDeleteOptions) (*runtime.Poller[UsersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) @@ -145,6 +149,7 @@ func (client *UsersClient) BeginDelete(ctx context.Context, deviceName string, n // Delete - Deletes the user on a databox edge/gateway device. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 func (client *UsersClient) deleteOperation(ctx context.Context, deviceName string, name string, resourceGroupName string, options *UsersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, deviceName, name, resourceGroupName, options) @@ -193,11 +198,12 @@ func (client *UsersClient) deleteCreateRequest(ctx context.Context, deviceName s // Get - Gets the properties of the specified user. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// name - The user name. -// resourceGroupName - The resource group name. -// options - UsersClientGetOptions contains the optional parameters for the UsersClient.Get method. +// - deviceName - The device name. +// - name - The user name. +// - resourceGroupName - The resource group name. +// - options - UsersClientGetOptions contains the optional parameters for the UsersClient.Get method. func (client *UsersClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string, options *UsersClientGetOptions) (UsersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, deviceName, name, resourceGroupName, options) if err != nil { @@ -253,12 +259,12 @@ func (client *UsersClient) getHandleResponse(resp *http.Response) (UsersClientGe } // NewListByDataBoxEdgeDevicePager - Gets all the users registered on a Data Box Edge/Data Box Gateway device. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// deviceName - The device name. -// resourceGroupName - The resource group name. -// options - UsersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the UsersClient.ListByDataBoxEdgeDevice -// method. +// - deviceName - The device name. +// - resourceGroupName - The resource group name. +// - options - UsersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the UsersClient.NewListByDataBoxEdgeDevicePager +// method. func (client *UsersClient) NewListByDataBoxEdgeDevicePager(deviceName string, resourceGroupName string, options *UsersClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[UsersClientListByDataBoxEdgeDeviceResponse] { return runtime.NewPager(runtime.PagingHandler[UsersClientListByDataBoxEdgeDeviceResponse]{ More: func(page UsersClientListByDataBoxEdgeDeviceResponse) bool { diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_addons_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_addons_client_test.go deleted file mode 100644 index 8f9ac765bde7..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_addons_client_test.go +++ /dev/null @@ -1,132 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/RoleListAddOns.json -func ExampleAddonsClient_NewListByRolePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewAddonsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByRolePager("testedgedevice", - "IoTRole1", - "GroupForEdgeAutomation", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/GetAddons.json -func ExampleAddonsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewAddonsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "KubernetesRole", - "arcName", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/PutAddons.json -func ExampleAddonsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewAddonsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testedgedevice", - "KubernetesRole", - "arcName", - "GroupForEdgeAutomation", - &armdataboxedge.ArcAddon{ - Kind: to.Ptr(armdataboxedge.AddonTypeArcForKubernetes), - Properties: &armdataboxedge.ArcAddonProperties{ - ResourceGroupName: to.Ptr("GroupForEdgeAutomation"), - ResourceLocation: to.Ptr("EastUS"), - ResourceName: to.Ptr("testedgedevice"), - SubscriptionID: to.Ptr("4385cf00-2d3a-425a-832f-f4285b1c9dce"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DeleteAddons.json -func ExampleAddonsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewAddonsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testedgedevice", - "KubernetesRole", - "arcName", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_alerts_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_alerts_client_test.go deleted file mode 100644 index 82da13574749..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_alerts_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/AlertGetAllInDevice.json -func ExampleAlertsClient_NewListByDataBoxEdgeDevicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewAlertsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataBoxEdgeDevicePager("testedgedevice", - "GroupForEdgeAutomation", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/AlertGet.json -func ExampleAlertsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewAlertsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "159a00c7-8543-4343-9435-263ac87df3bb", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_availableskus_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_availableskus_client_test.go deleted file mode 100644 index fca7a9a56a71..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_availableskus_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/AvailableSkusList.json -func ExampleAvailableSKUsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewAvailableSKUsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_bandwidthschedules_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_bandwidthschedules_client_test.go deleted file mode 100644 index 95abf3565a5b..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_bandwidthschedules_client_test.go +++ /dev/null @@ -1,129 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/BandwidthScheduleGetAllInDevice.json -func ExampleBandwidthSchedulesClient_NewListByDataBoxEdgeDevicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewBandwidthSchedulesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataBoxEdgeDevicePager("testedgedevice", - "GroupForEdgeAutomation", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/BandwidthScheduleGet.json -func ExampleBandwidthSchedulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewBandwidthSchedulesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "bandwidth-1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/BandwidthSchedulePut.json -func ExampleBandwidthSchedulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewBandwidthSchedulesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testedgedevice", - "bandwidth-1", - "GroupForEdgeAutomation", - armdataboxedge.BandwidthSchedule{ - Properties: &armdataboxedge.BandwidthScheduleProperties{ - Days: []*armdataboxedge.DayOfWeek{ - to.Ptr(armdataboxedge.DayOfWeekSunday), - to.Ptr(armdataboxedge.DayOfWeekMonday)}, - RateInMbps: to.Ptr[int32](100), - Start: to.Ptr("0:0:0"), - Stop: to.Ptr("13:59:0"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/BandwidthScheduleDelete.json -func ExampleBandwidthSchedulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewBandwidthSchedulesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testedgedevice", - "bandwidth-1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_containers_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_containers_client_test.go deleted file mode 100644 index dfc920898273..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_containers_client_test.go +++ /dev/null @@ -1,154 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/ContainerListAllInDevice.json -func ExampleContainersClient_NewListByStorageAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewContainersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByStorageAccountPager("testedgedevice", - "storageaccount1", - "GroupForEdgeAutomation", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/ContainerGet.json -func ExampleContainersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewContainersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "storageaccount1", - "blobcontainer1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/ContainerPut.json -func ExampleContainersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewContainersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testedgedevice", - "storageaccount1", - "blobcontainer1", - "GroupForEdgeAutomation", - armdataboxedge.Container{ - Properties: &armdataboxedge.ContainerProperties{ - DataFormat: to.Ptr(armdataboxedge.AzureContainerDataFormatBlockBlob), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/ContainerDelete.json -func ExampleContainersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewContainersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testedgedevice", - "storageaccount1", - "blobcontainer1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/ContainerRefresh.json -func ExampleContainersClient_BeginRefresh() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewContainersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRefresh(ctx, - "testedgedevice", - "storageaccount1", - "blobcontainer1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_devicecapacitycheck_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_devicecapacitycheck_client_test.go deleted file mode 100644 index f396d34da198..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_devicecapacitycheck_client_test.go +++ /dev/null @@ -1,49 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DeviceCapacityRequestPost.json -func ExampleDeviceCapacityCheckClient_BeginCheckResourceCreationFeasibility() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDeviceCapacityCheckClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCheckResourceCreationFeasibility(ctx, - "GroupForEdgeAutomation", - "testedgedevice", - armdataboxedge.DeviceCapacityRequestInfo{ - Properties: &armdataboxedge.DeviceCapacityRequestInfoProperties{ - VMPlacementQuery: [][]*string{ - { - to.Ptr("Standard_D2_v2")}}, - }, - }, - &armdataboxedge.DeviceCapacityCheckClientBeginCheckResourceCreationFeasibilityOptions{CapacityName: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_devicecapacityinfo_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_devicecapacityinfo_client_test.go deleted file mode 100644 index 543c1e080a26..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_devicecapacityinfo_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DeviceCapacityGet.json -func ExampleDeviceCapacityInfoClient_GetDeviceCapacityInfo() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDeviceCapacityInfoClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDeviceCapacityInfo(ctx, - "GroupForEdgeAutomation", - "testedgedevice", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_devices_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_devices_client_test.go deleted file mode 100644 index c2e3cd3b8d0d..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_devices_client_test.go +++ /dev/null @@ -1,417 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DataBoxEdgeDeviceGetBySubscription.json -func ExampleDevicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(&armdataboxedge.DevicesClientListBySubscriptionOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DataBoxEdgeDeviceGetByResourceGroup.json -func ExampleDevicesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("GroupForEdgeAutomation", - &armdataboxedge.DevicesClientListByResourceGroupOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DataBoxEdgeDeviceGetByName.json -func ExampleDevicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DataBoxEdgeDevicePut.json -func ExampleDevicesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - armdataboxedge.Device{ - Location: to.Ptr("WUS"), - SKU: &armdataboxedge.SKUInfo{ - Name: to.Ptr(armdataboxedge.SKUNameEdge), - Tier: to.Ptr(armdataboxedge.SKUTierStandard), - }, - Tags: map[string]*string{}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DataBoxEdgeDeviceDelete.json -func ExampleDevicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DataBoxEdgeDevicePatch.json -func ExampleDevicesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - armdataboxedge.DevicePatch{ - Properties: &armdataboxedge.DevicePropertiesPatch{ - EdgeProfile: &armdataboxedge.EdgeProfilePatch{ - Subscription: &armdataboxedge.EdgeProfileSubscriptionPatch{ - ID: to.Ptr("/subscriptions/0d44739e-0563-474f-97e7-24a0cdb23b29/resourceGroups/rapvs-rg/providers/Microsoft.AzureStack/linkedSubscriptions/ca014ddc-5cf2-45f8-b390-e901e4a0ae87"), - }, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DownloadUpdatesPost.json -func ExampleDevicesClient_BeginDownloadUpdates() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDownloadUpdates(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/GenerateCertificate.json -func ExampleDevicesClient_GenerateCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GenerateCertificate(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/ExtendedInfoPost.json -func ExampleDevicesClient_GetExtendedInformation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetExtendedInformation(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/InstallUpdatesPost.json -func ExampleDevicesClient_BeginInstallUpdates() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginInstallUpdates(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/NetworkSettingsGet.json -func ExampleDevicesClient_GetNetworkSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetNetworkSettings(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/ScanForUpdatesPost.json -func ExampleDevicesClient_BeginScanForUpdates() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginScanForUpdates(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/SecuritySettingsUpdatePost.json -func ExampleDevicesClient_BeginCreateOrUpdateSecuritySettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdateSecuritySettings(ctx, - "testedgedevice", - "AzureVM", - armdataboxedge.SecuritySettings{ - Properties: &armdataboxedge.SecuritySettingsProperties{ - DeviceAdminPassword: &armdataboxedge.AsymmetricEncryptedSecret{ - EncryptionAlgorithm: to.Ptr(armdataboxedge.EncryptionAlgorithmAES256), - EncryptionCertThumbprint: to.Ptr(""), - Value: to.Ptr(""), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/GetUpdateExtendedInfo.json -func ExampleDevicesClient_UpdateExtendedInformation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UpdateExtendedInformation(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - armdataboxedge.DeviceExtendedInfoPatch{}, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/UpdateSummaryGet.json -func ExampleDevicesClient_GetUpdateSummary() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetUpdateSummary(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/UploadCertificatePost.json -func ExampleDevicesClient_UploadCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDevicesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UploadCertificate(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - armdataboxedge.UploadCertificateRequest{ - Properties: &armdataboxedge.RawCertificateData{ - Certificate: to.Ptr("MIIC9DCCAdygAwIBAgIQWJae7GNjiI9Mcv/gJyrOPTANBgkqhkiG9w0BAQUFADASMRAwDgYDVQQDDAdXaW5kb3dzMB4XDTE4MTEyNzAwMTA0NVoXDTIxMTEyODAwMTA0NVowEjEQMA4GA1UEAwwHV2luZG93czCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKxkRExqxf0qH1avnyORptIbRC2yQwqe3EIbJ2FPKr5jtAppGeX/dGKrFSnX+7/0HFr77aJHafdpEAtOiLyJ4zCAVs0obZCCIq4qJdmjYUTU0UXH/w/YzXfQA0d9Zh9AN+NJBX9xj05NzgsT24fkgsK2v6mWJQXT7YcWAsl5sEYPnx1e+MrupNyVSL/RUJmrS+etJSysHtFeWRhsUhVAs1DD5ExJvBLU3WH0IsojEvpXcjrutB5/MDQNrd/StGI6WovoSSPH7FyT9tgERx+q+Yg3YUGzfaIPCctlrRGehcdtzdNoKd0rsX62yCq0U6POoSfwe22NJu41oAUMd7e6R8cCAwEAAaNGMEQwEwYDVR0lBAwwCgYIKwYBBQUHAwIwHQYDVR0OBBYEFDd0VxnS3LnMIfwc7xW4b4IZWG5GMA4GA1UdDwEB/wQEAwIFIDANBgkqhkiG9w0BAQUFAAOCAQEAPQRby2u9celvtvL/DLEb5Vt3/tPStRQC5MyTD62L5RT/q8E6EMCXVZNkXF5WlWucLJi/18tY+9PNgP9xWLJh7kpSWlWdi9KPtwMqKDlEH8L2TnQdjimt9XuiCrTnoFy/1X2BGLY/rCaUJNSd15QCkz2xeW+Z+YSk2GwAc/A/4YfNpqSIMfNuPrT76o02VdD9WmJUA3fS/HY0sU9qgQRS/3F5/0EPS+HYQ0SvXCK9tggcCd4O050ytNBMJC9qMOJ7yE0iOrFfOJSCfDAuPhn/rHFh79Kn1moF+/CE+nc0/2RPiLC8r54/rt5dYyyxJDfXg0a3VrrX39W69WZGW5OXiw=="), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_diagnosticsettings_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_diagnosticsettings_client_test.go deleted file mode 100644 index 0dbb7e2fe5f2..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_diagnosticsettings_client_test.go +++ /dev/null @@ -1,131 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/GetDiagnosticProactiveLogCollectionSettings.json -func ExampleDiagnosticSettingsClient_GetDiagnosticProactiveLogCollectionSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDiagnosticSettingsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDiagnosticProactiveLogCollectionSettings(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/UpdateDiagnosticProactiveLogCollectionSettings.json -func ExampleDiagnosticSettingsClient_BeginUpdateDiagnosticProactiveLogCollectionSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDiagnosticSettingsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateDiagnosticProactiveLogCollectionSettings(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - armdataboxedge.DiagnosticProactiveLogCollectionSettings{ - Properties: &armdataboxedge.ProactiveLogCollectionSettingsProperties{ - UserConsent: to.Ptr(armdataboxedge.ProactiveDiagnosticsConsentEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/GetDiagnosticRemoteSupportSettings.json -func ExampleDiagnosticSettingsClient_GetDiagnosticRemoteSupportSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDiagnosticSettingsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDiagnosticRemoteSupportSettings(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/UpdateDiagnosticRemoteSupportSettings.json -func ExampleDiagnosticSettingsClient_BeginUpdateDiagnosticRemoteSupportSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewDiagnosticSettingsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateDiagnosticRemoteSupportSettings(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - armdataboxedge.DiagnosticRemoteSupportSettings{ - Properties: &armdataboxedge.DiagnosticRemoteSupportSettingsProperties{ - RemoteSupportSettingsList: []*armdataboxedge.RemoteSupportSettings{ - { - AccessLevel: to.Ptr(armdataboxedge.AccessLevelReadWrite), - ExpirationTimeStampInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-07T00:00:00+00:00"); return t }()), - RemoteApplicationType: to.Ptr(armdataboxedge.RemoteApplicationTypePowershell), - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_jobs_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_jobs_client_test.go deleted file mode 100644 index fb6279601075..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_jobs_client_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/JobsGet.json -func ExampleJobsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewJobsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "159a00c7-8543-4343-9435-263ac87df3bb", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_monitoringconfig_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_monitoringconfig_client_test.go deleted file mode 100644 index b981c1619210..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_monitoringconfig_client_test.go +++ /dev/null @@ -1,137 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/ListMonitoringConfig.json -func ExampleMonitoringConfigClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewMonitoringConfigClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("testedgedevice", - "testrole", - "GroupForEdgeAutomation", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/GetMonitoringConfig.json -func ExampleMonitoringConfigClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewMonitoringConfigClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "testrole", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/PutMonitoringConfig.json -func ExampleMonitoringConfigClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewMonitoringConfigClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testedgedevice", - "testrole", - "GroupForEdgeAutomation", - armdataboxedge.MonitoringMetricConfiguration{ - Properties: &armdataboxedge.MonitoringMetricConfigurationProperties{ - MetricConfigurations: []*armdataboxedge.MetricConfiguration{ - { - CounterSets: []*armdataboxedge.MetricCounterSet{ - { - Counters: []*armdataboxedge.MetricCounter{ - { - Name: to.Ptr("test"), - }}, - }}, - MdmAccount: to.Ptr("test"), - MetricNameSpace: to.Ptr("test"), - ResourceID: to.Ptr("test"), - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DeleteMonitoringConfig.json -func ExampleMonitoringConfigClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewMonitoringConfigClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testedgedevice", - "testrole", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_nodes_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_nodes_client_test.go deleted file mode 100644 index 38151512b36c..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_nodes_client_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/NodeGetAllInDevice.json -func ExampleNodesClient_NewListByDataBoxEdgeDevicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewNodesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataBoxEdgeDevicePager("testedgedevice", - "GroupForEdgeAutomation", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_operations_client_test.go deleted file mode 100644 index 45bd1f89eb81..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/OperationsGet.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_operationsstatus_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_operationsstatus_client_test.go deleted file mode 100644 index fa5050df5655..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_operationsstatus_client_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/OperationsStatusGet.json -func ExampleOperationsStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewOperationsStatusClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "159a00c7-8543-4343-9435-263ac87df3bb", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_orders_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_orders_client_test.go deleted file mode 100644 index fed87562eaed..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_orders_client_test.go +++ /dev/null @@ -1,158 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/OrderGetAllInDevice.json -func ExampleOrdersClient_NewListByDataBoxEdgeDevicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewOrdersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataBoxEdgeDevicePager("testedgedevice", - "GroupForEdgeAutomation", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/OrderGet.json -func ExampleOrdersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewOrdersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/OrderPut.json -func ExampleOrdersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewOrdersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - armdataboxedge.Order{ - Properties: &armdataboxedge.OrderProperties{ - ContactInformation: &armdataboxedge.ContactDetails{ - CompanyName: to.Ptr("Microsoft"), - ContactPerson: to.Ptr("John Mcclane"), - EmailList: []*string{ - to.Ptr("john@microsoft.com")}, - Phone: to.Ptr("(800) 426-9400"), - }, - ShippingAddress: &armdataboxedge.Address{ - AddressLine1: to.Ptr("Microsoft Corporation"), - AddressLine2: to.Ptr("One Microsoft Way"), - AddressLine3: to.Ptr("Redmond"), - City: to.Ptr("WA"), - Country: to.Ptr("USA"), - PostalCode: to.Ptr("98052"), - State: to.Ptr("WA"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/OrderDelete.json -func ExampleOrdersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewOrdersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/GetDCAccessCode.json -func ExampleOrdersClient_ListDCAccessCode() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewOrdersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListDCAccessCode(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_roles_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_roles_client_test.go deleted file mode 100644 index b85af6e78b19..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_roles_client_test.go +++ /dev/null @@ -1,153 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/RoleGetAllInDevice.json -func ExampleRolesClient_NewListByDataBoxEdgeDevicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewRolesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataBoxEdgeDevicePager("testedgedevice", - "GroupForEdgeAutomation", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/RoleGet.json -func ExampleRolesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewRolesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "IoTRole1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/RolePut.json -func ExampleRolesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewRolesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testedgedevice", - "IoTRole1", - "GroupForEdgeAutomation", - &armdataboxedge.IoTRole{ - Kind: to.Ptr(armdataboxedge.RoleTypesIOT), - Properties: &armdataboxedge.IoTRoleProperties{ - HostPlatform: to.Ptr(armdataboxedge.PlatformTypeLinux), - IoTDeviceDetails: &armdataboxedge.IoTDeviceInfo{ - Authentication: &armdataboxedge.Authentication{ - SymmetricKey: &armdataboxedge.SymmetricKey{ - ConnectionString: &armdataboxedge.AsymmetricEncryptedSecret{ - EncryptionAlgorithm: to.Ptr(armdataboxedge.EncryptionAlgorithmAES256), - EncryptionCertThumbprint: to.Ptr("348586569999244"), - Value: to.Ptr("Encrypted<>"), - }, - }, - }, - DeviceID: to.Ptr("iotdevice"), - IoTHostHub: to.Ptr("iothub.azure-devices.net"), - }, - IoTEdgeDeviceDetails: &armdataboxedge.IoTDeviceInfo{ - Authentication: &armdataboxedge.Authentication{ - SymmetricKey: &armdataboxedge.SymmetricKey{ - ConnectionString: &armdataboxedge.AsymmetricEncryptedSecret{ - EncryptionAlgorithm: to.Ptr(armdataboxedge.EncryptionAlgorithmAES256), - EncryptionCertThumbprint: to.Ptr("1245475856069999244"), - Value: to.Ptr("Encrypted<>"), - }, - }, - }, - DeviceID: to.Ptr("iotEdge"), - IoTHostHub: to.Ptr("iothub.azure-devices.net"), - }, - RoleStatus: to.Ptr(armdataboxedge.RoleStatusEnabled), - ShareMappings: []*armdataboxedge.MountPointMap{}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/RoleDelete.json -func ExampleRolesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewRolesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testedgedevice", - "IoTRole1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_shares_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_shares_client_test.go deleted file mode 100644 index 36fa825f9c05..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_shares_client_test.go +++ /dev/null @@ -1,163 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/ShareGetAllInDevice.json -func ExampleSharesClient_NewListByDataBoxEdgeDevicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewSharesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataBoxEdgeDevicePager("testedgedevice", - "GroupForEdgeAutomation", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/ShareGet.json -func ExampleSharesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewSharesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "smbshare", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/SharePut.json -func ExampleSharesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewSharesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testedgedevice", - "smbshare", - "GroupForEdgeAutomation", - armdataboxedge.Share{ - Properties: &armdataboxedge.ShareProperties{ - Description: to.Ptr(""), - AccessProtocol: to.Ptr(armdataboxedge.ShareAccessProtocolSMB), - AzureContainerInfo: &armdataboxedge.AzureContainerInfo{ - ContainerName: to.Ptr("testContainerSMB"), - DataFormat: to.Ptr(armdataboxedge.AzureContainerDataFormatBlockBlob), - StorageAccountCredentialID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/storageAccountCredentials/sac1"), - }, - DataPolicy: to.Ptr(armdataboxedge.DataPolicyCloud), - MonitoringStatus: to.Ptr(armdataboxedge.MonitoringStatusEnabled), - ShareStatus: to.Ptr(armdataboxedge.ShareStatus("Online")), - UserAccessRights: []*armdataboxedge.UserAccessRight{ - { - AccessType: to.Ptr(armdataboxedge.ShareAccessTypeChange), - UserID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/users/user2"), - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/ShareDelete.json -func ExampleSharesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewSharesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testedgedevice", - "smbshare", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/ShareRefreshPost.json -func ExampleSharesClient_BeginRefresh() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewSharesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRefresh(ctx, - "testedgedevice", - "smbshare", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_storageaccountcredentials_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_storageaccountcredentials_client_test.go deleted file mode 100644 index 6ae17d225e1d..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_storageaccountcredentials_client_test.go +++ /dev/null @@ -1,132 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/SACGetAllInDevice.json -func ExampleStorageAccountCredentialsClient_NewListByDataBoxEdgeDevicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewStorageAccountCredentialsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataBoxEdgeDevicePager("testedgedevice", - "GroupForEdgeAutomation", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/SACGet.json -func ExampleStorageAccountCredentialsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewStorageAccountCredentialsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "sac1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/SACPut.json -func ExampleStorageAccountCredentialsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewStorageAccountCredentialsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testedgedevice", - "sac1", - "GroupForEdgeAutomation", - armdataboxedge.StorageAccountCredential{ - Properties: &armdataboxedge.StorageAccountCredentialProperties{ - AccountKey: &armdataboxedge.AsymmetricEncryptedSecret{ - EncryptionAlgorithm: to.Ptr(armdataboxedge.EncryptionAlgorithmAES256), - EncryptionCertThumbprint: to.Ptr("2A9D8D6BE51574B5461230AEF02F162C5F01AD31"), - Value: to.Ptr("lAeZEYi6rNP1/EyNaVUYmTSZEYyaIaWmwUsGwek0+xiZj54GM9Ue9/UA2ed/ClC03wuSit2XzM/cLRU5eYiFBwks23rGwiQOr3sruEL2a74EjPD050xYjA6M1I2hu/w2yjVHhn5j+DbXS4Xzi+rHHNZK3DgfDO3PkbECjPck+PbpSBjy9+6Mrjcld5DIZhUAeMlMHrFlg+WKRKB14o/og56u5/xX6WKlrMLEQ+y6E18dUwvWs2elTNoVO8PBE8SM/CfooX4AMNvaNdSObNBPdP+F6Lzc556nFNWXrBLRt0vC7s9qTiVRO4x/qCNaK/B4y7IqXMllwQFf4Np9UQ2ECA=="), - }, - AccountType: to.Ptr(armdataboxedge.AccountTypeBlobStorage), - Alias: to.Ptr("sac1"), - SSLStatus: to.Ptr(armdataboxedge.SSLStatusDisabled), - UserName: to.Ptr("cisbvt"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/SACDelete.json -func ExampleStorageAccountCredentialsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewStorageAccountCredentialsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testedgedevice", - "sac1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_storageaccounts_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_storageaccounts_client_test.go deleted file mode 100644 index 7a4ffd552d70..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_storageaccounts_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/StorageAccountGetAllInDevice.json -func ExampleStorageAccountsClient_NewListByDataBoxEdgeDevicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewStorageAccountsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataBoxEdgeDevicePager("testedgedevice", - "GroupForEdgeAutomation", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/StorageAccountGet.json -func ExampleStorageAccountsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewStorageAccountsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "blobstorageaccount1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/StorageAccountPut.json -func ExampleStorageAccountsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewStorageAccountsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testedgedevice", - "blobstorageaccount1", - "GroupForEdgeAutomation", - armdataboxedge.StorageAccount{ - Properties: &armdataboxedge.StorageAccountProperties{ - Description: to.Ptr("It's an awesome storage account"), - DataPolicy: to.Ptr(armdataboxedge.DataPolicyCloud), - StorageAccountCredentialID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForDataBoxEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/storageAccountCredentials/cisbvt"), - StorageAccountStatus: to.Ptr(armdataboxedge.StorageAccountStatusOK), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/StorageAccountDelete.json -func ExampleStorageAccountsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewStorageAccountsClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testedgedevice", - "storageaccount1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_supportpackages_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_supportpackages_client_test.go deleted file mode 100644 index 8bb4992d8d43..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_supportpackages_client_test.go +++ /dev/null @@ -1,51 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/TriggerSupportPackage.json -func ExampleSupportPackagesClient_BeginTriggerSupportPackage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewSupportPackagesClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTriggerSupportPackage(ctx, - "testedgedevice", - "GroupForEdgeAutomation", - armdataboxedge.TriggerSupportPackageRequest{ - Properties: &armdataboxedge.SupportPackageRequestProperties{ - Include: to.Ptr("DefaultWithDumps"), - MaximumTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-18T02:19:51.4270267Z"); return t }()), - MinimumTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-18T02:18:51.4270267Z"); return t }()), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_triggers_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_triggers_client_test.go deleted file mode 100644 index 48718a6909b8..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_triggers_client_test.go +++ /dev/null @@ -1,131 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/TriggerGetAllInDevice.json -func ExampleTriggersClient_NewListByDataBoxEdgeDevicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewTriggersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataBoxEdgeDevicePager("testedgedevice", - "GroupForEdgeAutomation", - &armdataboxedge.TriggersClientListByDataBoxEdgeDeviceOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/TriggerGet.json -func ExampleTriggersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewTriggersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "trigger1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/TriggerPut.json -func ExampleTriggersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewTriggersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testedgedevice", - "trigger1", - "GroupForEdgeAutomation", - &armdataboxedge.FileEventTrigger{ - Kind: to.Ptr(armdataboxedge.TriggerEventTypeFileEvent), - Properties: &armdataboxedge.FileTriggerProperties{ - CustomContextTag: to.Ptr("CustomContextTags-1235346475"), - SinkInfo: &armdataboxedge.RoleSinkInfo{ - RoleID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/role1"), - }, - SourceInfo: &armdataboxedge.FileSourceInfo{ - ShareID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/shares/share1"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/TriggerDelete.json -func ExampleTriggersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewTriggersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testedgedevice", - "trigger1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_users_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_users_client_test.go deleted file mode 100644 index d8f1835f4560..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_users_client_test.go +++ /dev/null @@ -1,129 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/UserGetAllInDevice.json -func ExampleUsersClient_NewListByDataBoxEdgeDevicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewUsersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDataBoxEdgeDevicePager("testedgedevice", - "GroupForEdgeAutomation", - &armdataboxedge.UsersClientListByDataBoxEdgeDeviceOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/UserGet.json -func ExampleUsersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewUsersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testedgedevice", - "user1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/UserPut.json -func ExampleUsersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewUsersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testedgedevice", - "user1", - "GroupForEdgeAutomation", - armdataboxedge.User{ - Properties: &armdataboxedge.UserProperties{ - EncryptedPassword: &armdataboxedge.AsymmetricEncryptedSecret{ - EncryptionAlgorithm: to.Ptr(armdataboxedge.EncryptionAlgorithmNone), - EncryptionCertThumbprint: to.Ptr("blah"), - Value: to.Ptr(""), - }, - UserType: to.Ptr(armdataboxedge.UserTypeShare), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/UserDelete.json -func ExampleUsersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdataboxedge.NewUsersClient("4385cf00-2d3a-425a-832f-f4285b1c9dce", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testedgedevice", - "user1", - "GroupForEdgeAutomation", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_models_serde.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_models_serde.go deleted file mode 100644 index 95c8dabaea58..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_models_serde.go +++ /dev/null @@ -1,1379 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// UnmarshalJSON implements the json.Unmarshaller interface for type AddonList. -func (a *AddonList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - a.Value, err = unmarshalAddonClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AlertProperties. -func (a AlertProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertType", a.AlertType) - populateTimeRFC3339(objectMap, "appearedAtDateTime", a.AppearedAtDateTime) - populate(objectMap, "detailedInformation", a.DetailedInformation) - populate(objectMap, "errorDetails", a.ErrorDetails) - populate(objectMap, "recommendation", a.Recommendation) - populate(objectMap, "severity", a.Severity) - populate(objectMap, "title", a.Title) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AlertProperties. -func (a *AlertProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "alertType": - err = unpopulate(val, "AlertType", &a.AlertType) - delete(rawMsg, key) - case "appearedAtDateTime": - err = unpopulateTimeRFC3339(val, "AppearedAtDateTime", &a.AppearedAtDateTime) - delete(rawMsg, key) - case "detailedInformation": - err = unpopulate(val, "DetailedInformation", &a.DetailedInformation) - delete(rawMsg, key) - case "errorDetails": - err = unpopulate(val, "ErrorDetails", &a.ErrorDetails) - delete(rawMsg, key) - case "recommendation": - err = unpopulate(val, "Recommendation", &a.Recommendation) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &a.Severity) - delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &a.Title) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ArcAddon. -func (a ArcAddon) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - objectMap["kind"] = AddonTypeArcForKubernetes - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ArcAddon. -func (a *ArcAddon) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BandwidthScheduleProperties. -func (b BandwidthScheduleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "days", b.Days) - populate(objectMap, "rateInMbps", b.RateInMbps) - populate(objectMap, "start", b.Start) - populate(objectMap, "stop", b.Stop) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CloudEdgeManagementRole. -func (c CloudEdgeManagementRole) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - objectMap["kind"] = RoleTypesCloudEdgeManagement - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEdgeManagementRole. -func (c *CloudEdgeManagementRole) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &c.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ClusterCapacityViewData. -func (c ClusterCapacityViewData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "fqdn", c.Fqdn) - populate(objectMap, "gpuCapacity", c.GpuCapacity) - populateTimeRFC3339(objectMap, "lastRefreshedTime", c.LastRefreshedTime) - populate(objectMap, "memoryCapacity", c.MemoryCapacity) - populate(objectMap, "totalProvisionedNonHpnCores", c.TotalProvisionedNonHpnCores) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterCapacityViewData. -func (c *ClusterCapacityViewData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "fqdn": - err = unpopulate(val, "Fqdn", &c.Fqdn) - delete(rawMsg, key) - case "gpuCapacity": - err = unpopulate(val, "GpuCapacity", &c.GpuCapacity) - delete(rawMsg, key) - case "lastRefreshedTime": - err = unpopulateTimeRFC3339(val, "LastRefreshedTime", &c.LastRefreshedTime) - delete(rawMsg, key) - case "memoryCapacity": - err = unpopulate(val, "MemoryCapacity", &c.MemoryCapacity) - delete(rawMsg, key) - case "totalProvisionedNonHpnCores": - err = unpopulate(val, "TotalProvisionedNonHpnCores", &c.TotalProvisionedNonHpnCores) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContactDetails. -func (c ContactDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "companyName", c.CompanyName) - populate(objectMap, "contactPerson", c.ContactPerson) - populate(objectMap, "emailList", c.EmailList) - populate(objectMap, "phone", c.Phone) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerProperties. -func (c ContainerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "containerStatus", c.ContainerStatus) - populateTimeRFC3339(objectMap, "createdDateTime", c.CreatedDateTime) - populate(objectMap, "dataFormat", c.DataFormat) - populate(objectMap, "refreshDetails", c.RefreshDetails) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerProperties. -func (c *ContainerProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "containerStatus": - err = unpopulate(val, "ContainerStatus", &c.ContainerStatus) - delete(rawMsg, key) - case "createdDateTime": - err = unpopulateTimeRFC3339(val, "CreatedDateTime", &c.CreatedDateTime) - delete(rawMsg, key) - case "dataFormat": - err = unpopulate(val, "DataFormat", &c.DataFormat) - delete(rawMsg, key) - case "refreshDetails": - err = unpopulate(val, "RefreshDetails", &c.RefreshDetails) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Device. -func (d Device) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", d.Etag) - populate(objectMap, "id", d.ID) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "kind", d.Kind) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DeviceCapacityInfoProperties. -func (d DeviceCapacityInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clusterComputeCapacityInfo", d.ClusterComputeCapacityInfo) - populate(objectMap, "clusterStorageCapacityInfo", d.ClusterStorageCapacityInfo) - populate(objectMap, "nodeCapacityInfos", d.NodeCapacityInfos) - populateTimeRFC3339(objectMap, "timeStamp", d.TimeStamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceCapacityInfoProperties. -func (d *DeviceCapacityInfoProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clusterComputeCapacityInfo": - err = unpopulate(val, "ClusterComputeCapacityInfo", &d.ClusterComputeCapacityInfo) - delete(rawMsg, key) - case "clusterStorageCapacityInfo": - err = unpopulate(val, "ClusterStorageCapacityInfo", &d.ClusterStorageCapacityInfo) - delete(rawMsg, key) - case "nodeCapacityInfos": - err = unpopulate(val, "NodeCapacityInfos", &d.NodeCapacityInfos) - delete(rawMsg, key) - case "timeStamp": - err = unpopulateTimeRFC3339(val, "TimeStamp", &d.TimeStamp) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeviceCapacityRequestInfoProperties. -func (d DeviceCapacityRequestInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "vmPlacementQuery", d.VMPlacementQuery) - populate(objectMap, "vmPlacementResults", d.VMPlacementResults) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DeviceExtendedInfoProperties. -func (d DeviceExtendedInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "channelIntegrityKeyName", d.ChannelIntegrityKeyName) - populate(objectMap, "channelIntegrityKeyVersion", d.ChannelIntegrityKeyVersion) - populate(objectMap, "clientSecretStoreId", d.ClientSecretStoreID) - populate(objectMap, "clientSecretStoreUrl", d.ClientSecretStoreURL) - populate(objectMap, "cloudWitnessContainerName", d.CloudWitnessContainerName) - populate(objectMap, "cloudWitnessStorageAccountName", d.CloudWitnessStorageAccountName) - populate(objectMap, "cloudWitnessStorageEndpoint", d.CloudWitnessStorageEndpoint) - populate(objectMap, "clusterWitnessType", d.ClusterWitnessType) - populate(objectMap, "deviceSecrets", d.DeviceSecrets) - populate(objectMap, "encryptionKey", d.EncryptionKey) - populate(objectMap, "encryptionKeyThumbprint", d.EncryptionKeyThumbprint) - populate(objectMap, "fileShareWitnessLocation", d.FileShareWitnessLocation) - populate(objectMap, "fileShareWitnessUsername", d.FileShareWitnessUsername) - populate(objectMap, "keyVaultSyncStatus", d.KeyVaultSyncStatus) - populate(objectMap, "resourceKey", d.ResourceKey) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DevicePatch. -func (d DevicePatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DeviceProperties. -func (d DeviceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "configuredRoleTypes", d.ConfiguredRoleTypes) - populate(objectMap, "culture", d.Culture) - populate(objectMap, "dataBoxEdgeDeviceStatus", d.DataBoxEdgeDeviceStatus) - populate(objectMap, "dataResidency", d.DataResidency) - populate(objectMap, "description", d.Description) - populate(objectMap, "deviceHcsVersion", d.DeviceHcsVersion) - populate(objectMap, "deviceLocalCapacity", d.DeviceLocalCapacity) - populate(objectMap, "deviceModel", d.DeviceModel) - populate(objectMap, "deviceSoftwareVersion", d.DeviceSoftwareVersion) - populate(objectMap, "deviceType", d.DeviceType) - populate(objectMap, "edgeProfile", d.EdgeProfile) - populate(objectMap, "friendlyName", d.FriendlyName) - populate(objectMap, "modelDescription", d.ModelDescription) - populate(objectMap, "nodeCount", d.NodeCount) - populate(objectMap, "resourceMoveDetails", d.ResourceMoveDetails) - populate(objectMap, "serialNumber", d.SerialNumber) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "timeZone", d.TimeZone) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticRemoteSupportSettingsProperties. -func (d DiagnosticRemoteSupportSettingsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "remoteSupportSettingsList", d.RemoteSupportSettingsList) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FileEventTrigger. -func (f FileEventTrigger) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", f.ID) - objectMap["kind"] = TriggerEventTypeFileEvent - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "systemData", f.SystemData) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FileEventTrigger. -func (f *FileEventTrigger) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &f.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &f.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &f.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &f.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HostCapacity. -func (h HostCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "availableGpuCount", h.AvailableGpuCount) - populate(objectMap, "effectiveAvailableMemoryMbOnHost", h.EffectiveAvailableMemoryMbOnHost) - populate(objectMap, "gpuType", h.GpuType) - populate(objectMap, "hostName", h.HostName) - populate(objectMap, "numaNodesData", h.NumaNodesData) - populate(objectMap, "vmUsedMemory", h.VMUsedMemory) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type IoTAddon. -func (i IoTAddon) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - objectMap["kind"] = AddonTypeIotEdge - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "systemData", i.SystemData) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IoTAddon. -func (i *IoTAddon) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &i.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &i.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IoTRole. -func (i IoTRole) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - objectMap["kind"] = RoleTypesIOT - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "systemData", i.SystemData) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IoTRole. -func (i *IoTRole) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &i.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &i.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IoTRoleProperties. -func (i IoTRoleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "computeResource", i.ComputeResource) - populate(objectMap, "hostPlatform", i.HostPlatform) - populate(objectMap, "hostPlatformType", i.HostPlatformType) - populate(objectMap, "ioTDeviceDetails", i.IoTDeviceDetails) - populate(objectMap, "ioTEdgeAgentInfo", i.IoTEdgeAgentInfo) - populate(objectMap, "ioTEdgeDeviceDetails", i.IoTEdgeDeviceDetails) - populate(objectMap, "roleStatus", i.RoleStatus) - populate(objectMap, "shareMappings", i.ShareMappings) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Job. -func (j *Job) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &j.Error) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &j.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &j.Name) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &j.PercentComplete) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &j.Properties) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &j.Status) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KubernetesClusterInfo. -func (k KubernetesClusterInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etcdInfo", k.EtcdInfo) - populate(objectMap, "nodes", k.Nodes) - populate(objectMap, "version", k.Version) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type KubernetesRole. -func (k KubernetesRole) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", k.ID) - objectMap["kind"] = RoleTypesKubernetes - populate(objectMap, "name", k.Name) - populate(objectMap, "properties", k.Properties) - populate(objectMap, "systemData", k.SystemData) - populate(objectMap, "type", k.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesRole. -func (k *KubernetesRole) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &k.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &k.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &k.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &k.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &k.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &k.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KubernetesRoleStorage. -func (k KubernetesRoleStorage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "endpoints", k.Endpoints) - populate(objectMap, "storageClasses", k.StorageClasses) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MECRole. -func (m MECRole) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - objectMap["kind"] = RoleTypesMEC - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MECRole. -func (m *MECRole) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MetricConfiguration. -func (m MetricConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "counterSets", m.CounterSets) - populate(objectMap, "mdmAccount", m.MdmAccount) - populate(objectMap, "metricNameSpace", m.MetricNameSpace) - populate(objectMap, "resourceId", m.ResourceID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MetricCounter. -func (m MetricCounter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalDimensions", m.AdditionalDimensions) - populate(objectMap, "dimensionFilter", m.DimensionFilter) - populate(objectMap, "instance", m.Instance) - populate(objectMap, "name", m.Name) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MetricCounterSet. -func (m MetricCounterSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "counters", m.Counters) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MonitoringMetricConfigurationProperties. -func (m MonitoringMetricConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "metricConfigurations", m.MetricConfigurations) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkAdapter. -func (n NetworkAdapter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "adapterId", n.AdapterID) - populate(objectMap, "adapterPosition", n.AdapterPosition) - populate(objectMap, "dnsServers", n.DNSServers) - populate(objectMap, "dhcpStatus", n.DhcpStatus) - populate(objectMap, "ipv4Configuration", n.IPv4Configuration) - populate(objectMap, "ipv6Configuration", n.IPv6Configuration) - populate(objectMap, "ipv6LinkLocalAddress", n.IPv6LinkLocalAddress) - populate(objectMap, "index", n.Index) - populate(objectMap, "label", n.Label) - populate(objectMap, "linkSpeed", n.LinkSpeed) - populate(objectMap, "macAddress", n.MacAddress) - populate(objectMap, "networkAdapterName", n.NetworkAdapterName) - populate(objectMap, "nodeId", n.NodeID) - populate(objectMap, "rdmaStatus", n.RdmaStatus) - populate(objectMap, "status", n.Status) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkSettingsProperties. -func (n NetworkSettingsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "networkAdapters", n.NetworkAdapters) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NodeInfo. -func (n NodeInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ipConfiguration", n.IPConfiguration) - populate(objectMap, "name", n.Name) - populate(objectMap, "type", n.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NumaNodeData. -func (n NumaNodeData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "effectiveAvailableMemoryInMb", n.EffectiveAvailableMemoryInMb) - populate(objectMap, "freeVCpuIndexesForHpn", n.FreeVCPUIndexesForHpn) - populate(objectMap, "logicalCoreCountPerCore", n.LogicalCoreCountPerCore) - populate(objectMap, "numaNodeIndex", n.NumaNodeIndex) - populate(objectMap, "totalMemoryInMb", n.TotalMemoryInMb) - populate(objectMap, "vCpuIndexesForHpn", n.VCPUIndexesForHpn) - populate(objectMap, "vCpuIndexesForRoot", n.VCPUIndexesForRoot) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OrderProperties. -func (o OrderProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contactInformation", o.ContactInformation) - populate(objectMap, "currentStatus", o.CurrentStatus) - populate(objectMap, "deliveryTrackingInfo", o.DeliveryTrackingInfo) - populate(objectMap, "orderHistory", o.OrderHistory) - populate(objectMap, "orderId", o.OrderID) - populate(objectMap, "returnTrackingInfo", o.ReturnTrackingInfo) - populate(objectMap, "serialNumber", o.SerialNumber) - populate(objectMap, "shipmentType", o.ShipmentType) - populate(objectMap, "shippingAddress", o.ShippingAddress) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OrderStatus. -func (o OrderStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalOrderDetails", o.AdditionalOrderDetails) - populate(objectMap, "comments", o.Comments) - populate(objectMap, "status", o.Status) - populate(objectMap, "trackingInformation", o.TrackingInformation) - populateTimeRFC3339(objectMap, "updateDateTime", o.UpdateDateTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OrderStatus. -func (o *OrderStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalOrderDetails": - err = unpopulate(val, "AdditionalOrderDetails", &o.AdditionalOrderDetails) - delete(rawMsg, key) - case "comments": - err = unpopulate(val, "Comments", &o.Comments) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &o.Status) - delete(rawMsg, key) - case "trackingInformation": - err = unpopulate(val, "TrackingInformation", &o.TrackingInformation) - delete(rawMsg, key) - case "updateDateTime": - err = unpopulateTimeRFC3339(val, "UpdateDateTime", &o.UpdateDateTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PeriodicTimerEventTrigger. -func (p PeriodicTimerEventTrigger) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - objectMap["kind"] = TriggerEventTypePeriodicTimerEvent - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicTimerEventTrigger. -func (p *PeriodicTimerEventTrigger) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &p.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PeriodicTimerSourceInfo. -func (p PeriodicTimerSourceInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "schedule", p.Schedule) - populateTimeRFC3339(objectMap, "startTime", p.StartTime) - populate(objectMap, "topic", p.Topic) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicTimerSourceInfo. -func (p *PeriodicTimerSourceInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "schedule": - err = unpopulate(val, "Schedule", &p.Schedule) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &p.StartTime) - delete(rawMsg, key) - case "topic": - err = unpopulate(val, "Topic", &p.Topic) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RefreshDetails. -func (r RefreshDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorManifestFile", r.ErrorManifestFile) - populate(objectMap, "inProgressRefreshJobId", r.InProgressRefreshJobID) - populateTimeRFC3339(objectMap, "lastCompletedRefreshJobTimeInUTC", r.LastCompletedRefreshJobTimeInUTC) - populate(objectMap, "lastJob", r.LastJob) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RefreshDetails. -func (r *RefreshDetails) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "errorManifestFile": - err = unpopulate(val, "ErrorManifestFile", &r.ErrorManifestFile) - delete(rawMsg, key) - case "inProgressRefreshJobId": - err = unpopulate(val, "InProgressRefreshJobID", &r.InProgressRefreshJobID) - delete(rawMsg, key) - case "lastCompletedRefreshJobTimeInUTC": - err = unpopulateTimeRFC3339(val, "LastCompletedRefreshJobTimeInUTC", &r.LastCompletedRefreshJobTimeInUTC) - delete(rawMsg, key) - case "lastJob": - err = unpopulate(val, "LastJob", &r.LastJob) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RemoteSupportSettings. -func (r RemoteSupportSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accessLevel", r.AccessLevel) - populateTimeRFC3339(objectMap, "expirationTimeStampInUTC", r.ExpirationTimeStampInUTC) - populate(objectMap, "remoteApplicationType", r.RemoteApplicationType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RemoteSupportSettings. -func (r *RemoteSupportSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "accessLevel": - err = unpopulate(val, "AccessLevel", &r.AccessLevel) - delete(rawMsg, key) - case "expirationTimeStampInUTC": - err = unpopulateTimeRFC3339(val, "ExpirationTimeStampInUTC", &r.ExpirationTimeStampInUTC) - delete(rawMsg, key) - case "remoteApplicationType": - err = unpopulate(val, "RemoteApplicationType", &r.RemoteApplicationType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceMoveDetails. -func (r ResourceMoveDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "operationInProgress", r.OperationInProgress) - populateTimeRFC3339(objectMap, "operationInProgressLockTimeoutInUTC", r.OperationInProgressLockTimeoutInUTC) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceMoveDetails. -func (r *ResourceMoveDetails) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "operationInProgress": - err = unpopulate(val, "OperationInProgress", &r.OperationInProgress) - delete(rawMsg, key) - case "operationInProgressLockTimeoutInUTC": - err = unpopulateTimeRFC3339(val, "OperationInProgressLockTimeoutInUTC", &r.OperationInProgressLockTimeoutInUTC) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleList. -func (r *RoleList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - r.Value, err = unmarshalRoleClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ShareProperties. -func (s ShareProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accessProtocol", s.AccessProtocol) - populate(objectMap, "azureContainerInfo", s.AzureContainerInfo) - populate(objectMap, "clientAccessRights", s.ClientAccessRights) - populate(objectMap, "dataPolicy", s.DataPolicy) - populate(objectMap, "description", s.Description) - populate(objectMap, "monitoringStatus", s.MonitoringStatus) - populate(objectMap, "refreshDetails", s.RefreshDetails) - populate(objectMap, "shareMappings", s.ShareMappings) - populate(objectMap, "shareStatus", s.ShareStatus) - populate(objectMap, "userAccessRights", s.UserAccessRights) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SubscriptionProperties. -func (s SubscriptionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "locationPlacementId", s.LocationPlacementID) - populate(objectMap, "quotaId", s.QuotaID) - populate(objectMap, "registeredFeatures", s.RegisteredFeatures) - populate(objectMap, "serializedDetails", s.SerializedDetails) - populate(objectMap, "tenantId", s.TenantID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SupportPackageRequestProperties. -func (s SupportPackageRequestProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "include", s.Include) - populateTimeRFC3339(objectMap, "maximumTimeStamp", s.MaximumTimeStamp) - populateTimeRFC3339(objectMap, "minimumTimeStamp", s.MinimumTimeStamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SupportPackageRequestProperties. -func (s *SupportPackageRequestProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "include": - err = unpopulate(val, "Include", &s.Include) - delete(rawMsg, key) - case "maximumTimeStamp": - err = unpopulateTimeRFC3339(val, "MaximumTimeStamp", &s.MaximumTimeStamp) - delete(rawMsg, key) - case "minimumTimeStamp": - err = unpopulateTimeRFC3339(val, "MinimumTimeStamp", &s.MinimumTimeStamp) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerList. -func (t *TriggerList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &t.NextLink) - delete(rawMsg, key) - case "value": - t.Value, err = unmarshalTriggerClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpdateSummaryProperties. -func (u UpdateSummaryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "deviceLastScannedDateTime", u.DeviceLastScannedDateTime) - populate(objectMap, "deviceVersionNumber", u.DeviceVersionNumber) - populate(objectMap, "friendlyDeviceVersionName", u.FriendlyDeviceVersionName) - populate(objectMap, "inProgressDownloadJobId", u.InProgressDownloadJobID) - populateTimeRFC3339(objectMap, "inProgressDownloadJobStartedDateTime", u.InProgressDownloadJobStartedDateTime) - populate(objectMap, "inProgressInstallJobId", u.InProgressInstallJobID) - populateTimeRFC3339(objectMap, "inProgressInstallJobStartedDateTime", u.InProgressInstallJobStartedDateTime) - populateTimeRFC3339(objectMap, "lastCompletedDownloadJobDateTime", u.LastCompletedDownloadJobDateTime) - populate(objectMap, "lastCompletedDownloadJobId", u.LastCompletedDownloadJobID) - populateTimeRFC3339(objectMap, "lastCompletedInstallJobDateTime", u.LastCompletedInstallJobDateTime) - populate(objectMap, "lastCompletedInstallJobId", u.LastCompletedInstallJobID) - populateTimeRFC3339(objectMap, "lastCompletedScanJobDateTime", u.LastCompletedScanJobDateTime) - populate(objectMap, "lastDownloadJobStatus", u.LastDownloadJobStatus) - populate(objectMap, "lastInstallJobStatus", u.LastInstallJobStatus) - populateTimeRFC3339(objectMap, "lastSuccessfulInstallJobDateTime", u.LastSuccessfulInstallJobDateTime) - populateTimeRFC3339(objectMap, "lastSuccessfulScanJobTime", u.LastSuccessfulScanJobTime) - populate(objectMap, "ongoingUpdateOperation", u.OngoingUpdateOperation) - populate(objectMap, "rebootBehavior", u.RebootBehavior) - populate(objectMap, "totalNumberOfUpdatesAvailable", u.TotalNumberOfUpdatesAvailable) - populate(objectMap, "totalNumberOfUpdatesPendingDownload", u.TotalNumberOfUpdatesPendingDownload) - populate(objectMap, "totalNumberOfUpdatesPendingInstall", u.TotalNumberOfUpdatesPendingInstall) - populate(objectMap, "totalTimeInMinutes", u.TotalTimeInMinutes) - populate(objectMap, "totalUpdateSizeInBytes", u.TotalUpdateSizeInBytes) - populate(objectMap, "updateTitles", u.UpdateTitles) - populate(objectMap, "updates", u.Updates) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateSummaryProperties. -func (u *UpdateSummaryProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "deviceLastScannedDateTime": - err = unpopulateTimeRFC3339(val, "DeviceLastScannedDateTime", &u.DeviceLastScannedDateTime) - delete(rawMsg, key) - case "deviceVersionNumber": - err = unpopulate(val, "DeviceVersionNumber", &u.DeviceVersionNumber) - delete(rawMsg, key) - case "friendlyDeviceVersionName": - err = unpopulate(val, "FriendlyDeviceVersionName", &u.FriendlyDeviceVersionName) - delete(rawMsg, key) - case "inProgressDownloadJobId": - err = unpopulate(val, "InProgressDownloadJobID", &u.InProgressDownloadJobID) - delete(rawMsg, key) - case "inProgressDownloadJobStartedDateTime": - err = unpopulateTimeRFC3339(val, "InProgressDownloadJobStartedDateTime", &u.InProgressDownloadJobStartedDateTime) - delete(rawMsg, key) - case "inProgressInstallJobId": - err = unpopulate(val, "InProgressInstallJobID", &u.InProgressInstallJobID) - delete(rawMsg, key) - case "inProgressInstallJobStartedDateTime": - err = unpopulateTimeRFC3339(val, "InProgressInstallJobStartedDateTime", &u.InProgressInstallJobStartedDateTime) - delete(rawMsg, key) - case "lastCompletedDownloadJobDateTime": - err = unpopulateTimeRFC3339(val, "LastCompletedDownloadJobDateTime", &u.LastCompletedDownloadJobDateTime) - delete(rawMsg, key) - case "lastCompletedDownloadJobId": - err = unpopulate(val, "LastCompletedDownloadJobID", &u.LastCompletedDownloadJobID) - delete(rawMsg, key) - case "lastCompletedInstallJobDateTime": - err = unpopulateTimeRFC3339(val, "LastCompletedInstallJobDateTime", &u.LastCompletedInstallJobDateTime) - delete(rawMsg, key) - case "lastCompletedInstallJobId": - err = unpopulate(val, "LastCompletedInstallJobID", &u.LastCompletedInstallJobID) - delete(rawMsg, key) - case "lastCompletedScanJobDateTime": - err = unpopulateTimeRFC3339(val, "LastCompletedScanJobDateTime", &u.LastCompletedScanJobDateTime) - delete(rawMsg, key) - case "lastDownloadJobStatus": - err = unpopulate(val, "LastDownloadJobStatus", &u.LastDownloadJobStatus) - delete(rawMsg, key) - case "lastInstallJobStatus": - err = unpopulate(val, "LastInstallJobStatus", &u.LastInstallJobStatus) - delete(rawMsg, key) - case "lastSuccessfulInstallJobDateTime": - err = unpopulateTimeRFC3339(val, "LastSuccessfulInstallJobDateTime", &u.LastSuccessfulInstallJobDateTime) - delete(rawMsg, key) - case "lastSuccessfulScanJobTime": - err = unpopulateTimeRFC3339(val, "LastSuccessfulScanJobTime", &u.LastSuccessfulScanJobTime) - delete(rawMsg, key) - case "ongoingUpdateOperation": - err = unpopulate(val, "OngoingUpdateOperation", &u.OngoingUpdateOperation) - delete(rawMsg, key) - case "rebootBehavior": - err = unpopulate(val, "RebootBehavior", &u.RebootBehavior) - delete(rawMsg, key) - case "totalNumberOfUpdatesAvailable": - err = unpopulate(val, "TotalNumberOfUpdatesAvailable", &u.TotalNumberOfUpdatesAvailable) - delete(rawMsg, key) - case "totalNumberOfUpdatesPendingDownload": - err = unpopulate(val, "TotalNumberOfUpdatesPendingDownload", &u.TotalNumberOfUpdatesPendingDownload) - delete(rawMsg, key) - case "totalNumberOfUpdatesPendingInstall": - err = unpopulate(val, "TotalNumberOfUpdatesPendingInstall", &u.TotalNumberOfUpdatesPendingInstall) - delete(rawMsg, key) - case "totalTimeInMinutes": - err = unpopulate(val, "TotalTimeInMinutes", &u.TotalTimeInMinutes) - delete(rawMsg, key) - case "totalUpdateSizeInBytes": - err = unpopulate(val, "TotalUpdateSizeInBytes", &u.TotalUpdateSizeInBytes) - delete(rawMsg, key) - case "updateTitles": - err = unpopulate(val, "UpdateTitles", &u.UpdateTitles) - delete(rawMsg, key) - case "updates": - err = unpopulate(val, "Updates", &u.Updates) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserProperties. -func (u UserProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "encryptedPassword", u.EncryptedPassword) - populate(objectMap, "shareAccessRights", u.ShareAccessRights) - populate(objectMap, "userType", u.UserType) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VMPlacementRequestResult. -func (v VMPlacementRequestResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "isFeasible", v.IsFeasible) - populate(objectMap, "message", v.Message) - populate(objectMap, "messageCode", v.MessageCode) - populate(objectMap, "vmSize", v.VMSize) - return json.Marshal(objectMap) -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}