From f1267a6bad1c81b15bb7eb7869b4ffe5d54bcccf Mon Sep 17 00:00:00 2001 From: Jiahui Peng <46921893+Alancere@users.noreply.github.com> Date: Mon, 27 Jun 2022 10:08:56 +0800 Subject: [PATCH] [Release] sdk/resourcemanager/operationalinsights/armoperationalinsights/2.0.0-beta.2 generation from spec commit: cf3574813e15bb33b3cb610f44edfcbebd8b1b23 (#18473) --- .../armoperationalinsights/CHANGELOG.md | 6 + .../armoperationalinsights/autorest.md | 6 +- ...ent.go => availableservicetiers_client.go} | 1 + ...ilableservicetiers_client_example_test.go} | 0 ..._clusters_client.go => clusters_client.go} | 1 + ...est.go => clusters_client_example_test.go} | 0 ...zz_generated_constants.go => constants.go} | 5 +- ...xports_client.go => dataexports_client.go} | 1 + ....go => dataexports_client_example_test.go} | 0 ...ources_client.go => datasources_client.go} | 1 + ....go => datasources_client_example_test.go} | 0 ..._client.go => deletedworkspaces_client.go} | 1 + ... deletedworkspaces_client_example_test.go} | 0 ..._gateways_client.go => gateways_client.go} | 1 + ...est.go => gateways_client_example_test.go} | 0 .../armoperationalinsights/go.mod | 4 +- .../armoperationalinsights/go.sum | 8 +- ..._client.go => intelligencepacks_client.go} | 1 + ... intelligencepacks_client_example_test.go} | 0 ...ces_client.go => linkedservices_client.go} | 1 + ... => linkedservices_client_example_test.go} | 0 ...ent.go => linkedstorageaccounts_client.go} | 1 + ...kedstorageaccounts_client_example_test.go} | 0 ...s_client.go => managementgroups_client.go} | 1 + ...> managementgroups_client_example_test.go} | 0 .../{zz_generated_models.go => models.go} | 1 + .../armoperationalinsights/models_serde.go | 3698 +++++++++++++++++ ...rations_client.go => operations_client.go} | 1 + ...t.go => operations_client_example_test.go} | 0 ..._client.go => operationstatuses_client.go} | 1 + ... operationstatuses_client_example_test.go} | 0 ...ed_queries_client.go => queries_client.go} | 1 + ...test.go => queries_client_example_test.go} | 0 ...rypacks_client.go => querypacks_client.go} | 1 + ...t.go => querypacks_client_example_test.go} | 0 ...ed_response_types.go => response_types.go} | 1 + ...ches_client.go => savedsearches_client.go} | 1 + ...o => savedsearches_client_example_test.go} | 0 ...ated_schema_client.go => schema_client.go} | 1 + ..._test.go => schema_client_example_test.go} | 0 ...redkeys_client.go => sharedkeys_client.go} | 1 + ...t.go => sharedkeys_client_example_test.go} | 0 ...ent.go => storageinsightconfigs_client.go} | 1 + ...rageinsightconfigs_client_example_test.go} | 0 ...ated_tables_client.go => tables_client.go} | 1 + ..._test.go => tables_client_example_test.go} | 0 ...erated_time_rfc3339.go => time_rfc3339.go} | 1 + ...ated_usages_client.go => usages_client.go} | 1 + ..._test.go => usages_client_example_test.go} | 0 ...rge_client.go => workspacepurge_client.go} | 1 + ... => workspacepurge_client_example_test.go} | 0 ...kspaces_client.go => workspaces_client.go} | 1 + ...t.go => workspaces_client_example_test.go} | 0 .../zz_generated_models_serde.go | 806 ---- 54 files changed, 3742 insertions(+), 816 deletions(-) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_availableservicetiers_client.go => availableservicetiers_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_availableservicetiers_client_test.go => availableservicetiers_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_clusters_client.go => clusters_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_clusters_client_test.go => clusters_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_constants.go => constants.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_dataexports_client.go => dataexports_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_dataexports_client_test.go => dataexports_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_datasources_client.go => datasources_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_datasources_client_test.go => datasources_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_deletedworkspaces_client.go => deletedworkspaces_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_deletedworkspaces_client_test.go => deletedworkspaces_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_gateways_client.go => gateways_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_gateways_client_test.go => gateways_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_intelligencepacks_client.go => intelligencepacks_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_intelligencepacks_client_test.go => intelligencepacks_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_linkedservices_client.go => linkedservices_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_linkedservices_client_test.go => linkedservices_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_linkedstorageaccounts_client.go => linkedstorageaccounts_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_linkedstorageaccounts_client_test.go => linkedstorageaccounts_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_managementgroups_client.go => managementgroups_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_managementgroups_client_test.go => managementgroups_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_models.go => models.go} (99%) create mode 100644 sdk/resourcemanager/operationalinsights/armoperationalinsights/models_serde.go rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_operations_client.go => operations_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_operations_client_test.go => operations_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_operationstatuses_client.go => operationstatuses_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_operationstatuses_client_test.go => operationstatuses_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_queries_client.go => queries_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_queries_client_test.go => queries_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_querypacks_client.go => querypacks_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_querypacks_client_test.go => querypacks_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_response_types.go => response_types.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_savedsearches_client.go => savedsearches_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_savedsearches_client_test.go => savedsearches_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_schema_client.go => schema_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_schema_client_test.go => schema_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_sharedkeys_client.go => sharedkeys_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_sharedkeys_client_test.go => sharedkeys_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_storageinsightconfigs_client.go => storageinsightconfigs_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_storageinsightconfigs_client_test.go => storageinsightconfigs_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_tables_client.go => tables_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_tables_client_test.go => tables_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_time_rfc3339.go => time_rfc3339.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_usages_client.go => usages_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_usages_client_test.go => usages_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_workspacepurge_client.go => workspacepurge_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_workspacepurge_client_test.go => workspacepurge_client_example_test.go} (100%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{zz_generated_workspaces_client.go => workspaces_client.go} (99%) rename sdk/resourcemanager/operationalinsights/armoperationalinsights/{ze_generated_example_workspaces_client_test.go => workspaces_client_example_test.go} (100%) delete mode 100644 sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/CHANGELOG.md b/sdk/resourcemanager/operationalinsights/armoperationalinsights/CHANGELOG.md index ebcc1dcf9f57..e17b62afdc4b 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/CHANGELOG.md +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 2.0.0-beta.2 (2022-06-24) +### Features Added + +- New const `DataSourceTypeIngestion` + + ## 2.0.0-beta.1 (2022-05-24) ### Breaking Changes diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/autorest.md b/sdk/resourcemanager/operationalinsights/armoperationalinsights/autorest.md index 92c89c2d07a8..2321167fb617 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/autorest.md +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/792db17291c758b2bfdbbc0d35d0e2f5b5a1bd05/specification/operationalinsights/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/792db17291c758b2bfdbbc0d35d0e2f5b5a1bd05/specification/operationalinsights/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/cf3574813e15bb33b3cb610f44edfcbebd8b1b23/specification/operationalinsights/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/cf3574813e15bb33b3cb610f44edfcbebd8b1b23/specification/operationalinsights/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0-beta.1 +module-version: 2.0.0-beta.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_availableservicetiers_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/availableservicetiers_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_availableservicetiers_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/availableservicetiers_client.go index 703ff56eec14..57124dda1c4f 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_availableservicetiers_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/availableservicetiers_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_availableservicetiers_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/availableservicetiers_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_availableservicetiers_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/availableservicetiers_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_clusters_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/clusters_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_clusters_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/clusters_client.go index 114ba6370efc..9c29f4df3db2 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_clusters_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/clusters_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_clusters_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/clusters_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_clusters_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/clusters_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_constants.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/constants.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_constants.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/constants.go index 242e1a7bcd55..9d7a9bcdcc4e 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_constants.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/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 armoperationalinsights const ( moduleName = "armoperationalinsights" - moduleVersion = "v2.0.0-beta.1" + moduleVersion = "v2.0.0-beta.2" ) // BillingType - Configures whether billing will be only on the cluster or each workspace will be billed by its proportional @@ -306,6 +307,7 @@ const ( DataSourceTypeCustomLogs DataSourceType = "CustomLogs" DataSourceTypeAzureWatson DataSourceType = "AzureWatson" DataSourceTypeQuery DataSourceType = "Query" + DataSourceTypeIngestion DataSourceType = "Ingestion" DataSourceTypeAlerts DataSourceType = "Alerts" ) @@ -315,6 +317,7 @@ func PossibleDataSourceTypeValues() []DataSourceType { DataSourceTypeCustomLogs, DataSourceTypeAzureWatson, DataSourceTypeQuery, + DataSourceTypeIngestion, DataSourceTypeAlerts, } } diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_dataexports_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/dataexports_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_dataexports_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/dataexports_client.go index 8fc126ce1dbd..6f44cd26d17e 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_dataexports_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/dataexports_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_dataexports_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/dataexports_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_dataexports_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/dataexports_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_datasources_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/datasources_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_datasources_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/datasources_client.go index 463036f43ac0..b0e5a55b4a04 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_datasources_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/datasources_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_datasources_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/datasources_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_datasources_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/datasources_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_deletedworkspaces_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/deletedworkspaces_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_deletedworkspaces_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/deletedworkspaces_client.go index 292131a06e0d..3708641d36bb 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_deletedworkspaces_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/deletedworkspaces_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_deletedworkspaces_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/deletedworkspaces_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_deletedworkspaces_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/deletedworkspaces_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_gateways_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/gateways_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_gateways_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/gateways_client.go index 411977f62666..e903abccec40 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_gateways_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/gateways_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_gateways_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/gateways_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_gateways_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/gateways_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/go.mod b/sdk/resourcemanager/operationalinsights/armoperationalinsights/go.mod index db3aef2adf25..8f404b8d34be 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/go.mod +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/go.mod @@ -4,12 +4,12 @@ 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 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.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/AzureAD/microsoft-authentication-library-for-go v0.5.1 // 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 diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/go.sum b/sdk/resourcemanager/operationalinsights/armoperationalinsights/go.sum index ed5b814680ee..8828b17b1853 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/go.sum +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/go.sum @@ -1,11 +1,11 @@ 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/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= 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/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= +github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/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= diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_intelligencepacks_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/intelligencepacks_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_intelligencepacks_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/intelligencepacks_client.go index 29c3cd64597d..ca045c554312 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_intelligencepacks_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/intelligencepacks_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_intelligencepacks_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/intelligencepacks_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_intelligencepacks_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/intelligencepacks_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_linkedservices_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedservices_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_linkedservices_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedservices_client.go index cb8416e7bb5d..ab113c10c2b0 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_linkedservices_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedservices_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_linkedservices_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedservices_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_linkedservices_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedservices_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_linkedstorageaccounts_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedstorageaccounts_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_linkedstorageaccounts_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedstorageaccounts_client.go index d3f20f2de4bf..2fee0c014040 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_linkedstorageaccounts_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedstorageaccounts_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_linkedstorageaccounts_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedstorageaccounts_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_linkedstorageaccounts_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedstorageaccounts_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_managementgroups_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/managementgroups_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_managementgroups_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/managementgroups_client.go index 69afe5393098..11133ac68b7c 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_managementgroups_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/managementgroups_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_managementgroups_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/managementgroups_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_managementgroups_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/managementgroups_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/models.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/models.go index a6a012647dc2..e5c4cb1c6e6b 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/models_serde.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/models_serde.go new file mode 100644 index 000000000000..695b5cb8b3d5 --- /dev/null +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/models_serde.go @@ -0,0 +1,3698 @@ +//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 armoperationalinsights + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AssociatedWorkspace. +func (a AssociatedWorkspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "associateDate", a.AssociateDate) + populate(objectMap, "resourceId", a.ResourceID) + populate(objectMap, "workspaceId", a.WorkspaceID) + populate(objectMap, "workspaceName", a.WorkspaceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssociatedWorkspace. +func (a *AssociatedWorkspace) 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 "associateDate": + err = unpopulate(val, "AssociateDate", &a.AssociateDate) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &a.ResourceID) + delete(rawMsg, key) + case "workspaceId": + err = unpopulate(val, "WorkspaceID", &a.WorkspaceID) + delete(rawMsg, key) + case "workspaceName": + err = unpopulate(val, "WorkspaceName", &a.WorkspaceName) + 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 AvailableServiceTier. +func (a AvailableServiceTier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacityReservationLevel", a.CapacityReservationLevel) + populate(objectMap, "defaultRetention", a.DefaultRetention) + populate(objectMap, "enabled", a.Enabled) + populate(objectMap, "lastSkuUpdate", a.LastSKUUpdate) + populate(objectMap, "maximumRetention", a.MaximumRetention) + populate(objectMap, "minimumRetention", a.MinimumRetention) + populate(objectMap, "serviceTier", a.ServiceTier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableServiceTier. +func (a *AvailableServiceTier) 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 "capacityReservationLevel": + err = unpopulate(val, "CapacityReservationLevel", &a.CapacityReservationLevel) + delete(rawMsg, key) + case "defaultRetention": + err = unpopulate(val, "DefaultRetention", &a.DefaultRetention) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &a.Enabled) + delete(rawMsg, key) + case "lastSkuUpdate": + err = unpopulate(val, "LastSKUUpdate", &a.LastSKUUpdate) + delete(rawMsg, key) + case "maximumRetention": + err = unpopulate(val, "MaximumRetention", &a.MaximumRetention) + delete(rawMsg, key) + case "minimumRetention": + err = unpopulate(val, "MinimumRetention", &a.MinimumRetention) + delete(rawMsg, key) + case "serviceTier": + err = unpopulate(val, "ServiceTier", &a.ServiceTier) + 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 AzureEntityResource. +func (a AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", a.Etag) + 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 AzureEntityResource. +func (a *AzureEntityResource) 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 "etag": + err = unpopulate(val, "Etag", &a.Etag) + delete(rawMsg, 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 AzureResourceProperties. +func (a AzureResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + 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 AzureResourceProperties. +func (a *AzureResourceProperties) 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 "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 CapacityReservationProperties. +func (c CapacityReservationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "lastSkuUpdate", c.LastSKUUpdate) + populate(objectMap, "minCapacity", c.MinCapacity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationProperties. +func (c *CapacityReservationProperties) 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 "lastSkuUpdate": + err = unpopulate(val, "LastSKUUpdate", &c.LastSKUUpdate) + delete(rawMsg, key) + case "minCapacity": + err = unpopulate(val, "MinCapacity", &c.MinCapacity) + 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 Cluster. +func (c Cluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "sku", c.SKU) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Cluster. +func (c *Cluster) 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 "identity": + err = unpopulate(val, "Identity", &c.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + 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 "sku": + err = unpopulate(val, "SKU", &c.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + 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 ClusterListResult. +func (c ClusterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterListResult. +func (c *ClusterListResult) 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 ClusterPatch. +func (c ClusterPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "sku", c.SKU) + populate(objectMap, "tags", c.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPatch. +func (c *ClusterPatch) 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 "identity": + err = unpopulate(val, "Identity", &c.Identity) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &c.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + 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 ClusterPatchProperties. +func (c ClusterPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "billingType", c.BillingType) + populate(objectMap, "keyVaultProperties", c.KeyVaultProperties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPatchProperties. +func (c *ClusterPatchProperties) 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 "billingType": + err = unpopulate(val, "BillingType", &c.BillingType) + delete(rawMsg, key) + case "keyVaultProperties": + err = unpopulate(val, "KeyVaultProperties", &c.KeyVaultProperties) + 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 ClusterProperties. +func (c ClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "associatedWorkspaces", c.AssociatedWorkspaces) + populate(objectMap, "billingType", c.BillingType) + populate(objectMap, "capacityReservationProperties", c.CapacityReservationProperties) + populate(objectMap, "clusterId", c.ClusterID) + populate(objectMap, "createdDate", c.CreatedDate) + populate(objectMap, "isAvailabilityZonesEnabled", c.IsAvailabilityZonesEnabled) + populate(objectMap, "isDoubleEncryptionEnabled", c.IsDoubleEncryptionEnabled) + populate(objectMap, "keyVaultProperties", c.KeyVaultProperties) + populate(objectMap, "lastModifiedDate", c.LastModifiedDate) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterProperties. +func (c *ClusterProperties) 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 "associatedWorkspaces": + err = unpopulate(val, "AssociatedWorkspaces", &c.AssociatedWorkspaces) + delete(rawMsg, key) + case "billingType": + err = unpopulate(val, "BillingType", &c.BillingType) + delete(rawMsg, key) + case "capacityReservationProperties": + err = unpopulate(val, "CapacityReservationProperties", &c.CapacityReservationProperties) + delete(rawMsg, key) + case "clusterId": + err = unpopulate(val, "ClusterID", &c.ClusterID) + delete(rawMsg, key) + case "createdDate": + err = unpopulate(val, "CreatedDate", &c.CreatedDate) + delete(rawMsg, key) + case "isAvailabilityZonesEnabled": + err = unpopulate(val, "IsAvailabilityZonesEnabled", &c.IsAvailabilityZonesEnabled) + delete(rawMsg, key) + case "isDoubleEncryptionEnabled": + err = unpopulate(val, "IsDoubleEncryptionEnabled", &c.IsDoubleEncryptionEnabled) + delete(rawMsg, key) + case "keyVaultProperties": + err = unpopulate(val, "KeyVaultProperties", &c.KeyVaultProperties) + delete(rawMsg, key) + case "lastModifiedDate": + err = unpopulate(val, "LastModifiedDate", &c.LastModifiedDate) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + 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 ClusterSKU. +func (c ClusterSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacity", c.Capacity) + populate(objectMap, "name", c.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterSKU. +func (c *ClusterSKU) 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 "capacity": + err = unpopulate(val, "Capacity", &c.Capacity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + 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 Column. +func (c Column) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataTypeHint", c.DataTypeHint) + populate(objectMap, "description", c.Description) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "isDefaultDisplay", c.IsDefaultDisplay) + populate(objectMap, "isHidden", c.IsHidden) + populate(objectMap, "name", c.Name) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Column. +func (c *Column) 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 "dataTypeHint": + err = unpopulate(val, "DataTypeHint", &c.DataTypeHint) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "isDefaultDisplay": + err = unpopulate(val, "IsDefaultDisplay", &c.IsDefaultDisplay) + delete(rawMsg, key) + case "isHidden": + err = unpopulate(val, "IsHidden", &c.IsHidden) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + 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 CoreSummary. +func (c CoreSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "numberOfDocuments", c.NumberOfDocuments) + populate(objectMap, "status", c.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CoreSummary. +func (c *CoreSummary) 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 "numberOfDocuments": + err = unpopulate(val, "NumberOfDocuments", &c.NumberOfDocuments) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &c.Status) + 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 DataExport. +func (d DataExport) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataExport. +func (d *DataExport) 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 "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 DataExportListResult. +func (d DataExportListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataExportListResult. +func (d *DataExportListResult) 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 "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 DataExportProperties. +func (d DataExportProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "createdDate", d.CreatedDate) + populate(objectMap, "dataExportId", d.DataExportID) + populate(objectMap, "destination", d.Destination) + populate(objectMap, "enable", d.Enable) + populate(objectMap, "lastModifiedDate", d.LastModifiedDate) + populate(objectMap, "tableNames", d.TableNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataExportProperties. +func (d *DataExportProperties) 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 "createdDate": + err = unpopulate(val, "CreatedDate", &d.CreatedDate) + delete(rawMsg, key) + case "dataExportId": + err = unpopulate(val, "DataExportID", &d.DataExportID) + delete(rawMsg, key) + case "destination": + err = unpopulate(val, "Destination", &d.Destination) + delete(rawMsg, key) + case "enable": + err = unpopulate(val, "Enable", &d.Enable) + delete(rawMsg, key) + case "lastModifiedDate": + err = unpopulate(val, "LastModifiedDate", &d.LastModifiedDate) + delete(rawMsg, key) + case "tableNames": + err = unpopulate(val, "TableNames", &d.TableNames) + 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 DataSource. +func (d DataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", d.Etag) + populate(objectMap, "id", d.ID) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", &d.Properties) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataSource. +func (d *DataSource) 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 "kind": + err = unpopulate(val, "Kind", &d.Kind) + 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 "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 DataSourceFilter. +func (d DataSourceFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "kind", d.Kind) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataSourceFilter. +func (d *DataSourceFilter) 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 "kind": + err = unpopulate(val, "Kind", &d.Kind) + 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 DataSourceListResult. +func (d DataSourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataSourceListResult. +func (d *DataSourceListResult) 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 Destination. +func (d Destination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metaData", d.MetaData) + populate(objectMap, "resourceId", d.ResourceID) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Destination. +func (d *Destination) 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 "metaData": + err = unpopulate(val, "MetaData", &d.MetaData) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &d.ResourceID) + 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 DestinationMetaData. +func (d DestinationMetaData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eventHubName", d.EventHubName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DestinationMetaData. +func (d *DestinationMetaData) 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 "eventHubName": + err = unpopulate(val, "EventHubName", &d.EventHubName) + 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 ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "info", &e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) 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 "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) 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 "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + 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 ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) 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 "error": + err = unpopulate(val, "Error", &e.Error) + 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 Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + populate(objectMap, "type", i.Type) + populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Identity. +func (i *Identity) 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 "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) + 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 IntelligencePack. +func (i IntelligencePack) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayName", i.DisplayName) + populate(objectMap, "enabled", i.Enabled) + populate(objectMap, "name", i.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IntelligencePack. +func (i *IntelligencePack) 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 "displayName": + err = unpopulate(val, "DisplayName", &i.DisplayName) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &i.Enabled) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + 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 KeyVaultProperties. +func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "keyName", k.KeyName) + populate(objectMap, "keyRsaSize", k.KeyRsaSize) + populate(objectMap, "keyVaultUri", k.KeyVaultURI) + populate(objectMap, "keyVersion", k.KeyVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties. +func (k *KeyVaultProperties) 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 "keyName": + err = unpopulate(val, "KeyName", &k.KeyName) + delete(rawMsg, key) + case "keyRsaSize": + err = unpopulate(val, "KeyRsaSize", &k.KeyRsaSize) + delete(rawMsg, key) + case "keyVaultUri": + err = unpopulate(val, "KeyVaultURI", &k.KeyVaultURI) + delete(rawMsg, key) + case "keyVersion": + err = unpopulate(val, "KeyVersion", &k.KeyVersion) + 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 LinkedService. +func (l LinkedService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "tags", l.Tags) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedService. +func (l *LinkedService) 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 "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + 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 LinkedServiceListResult. +func (l LinkedServiceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedServiceListResult. +func (l *LinkedServiceListResult) 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 "value": + err = unpopulate(val, "Value", &l.Value) + 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 LinkedServiceProperties. +func (l LinkedServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "resourceId", l.ResourceID) + populate(objectMap, "writeAccessResourceId", l.WriteAccessResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedServiceProperties. +func (l *LinkedServiceProperties) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &l.ResourceID) + delete(rawMsg, key) + case "writeAccessResourceId": + err = unpopulate(val, "WriteAccessResourceID", &l.WriteAccessResourceID) + 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 LinkedStorageAccountsListResult. +func (l LinkedStorageAccountsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedStorageAccountsListResult. +func (l *LinkedStorageAccountsListResult) 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 "value": + err = unpopulate(val, "Value", &l.Value) + 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 LinkedStorageAccountsProperties. +func (l LinkedStorageAccountsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataSourceType", l.DataSourceType) + populate(objectMap, "storageAccountIds", l.StorageAccountIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedStorageAccountsProperties. +func (l *LinkedStorageAccountsProperties) 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 "dataSourceType": + err = unpopulate(val, "DataSourceType", &l.DataSourceType) + delete(rawMsg, key) + case "storageAccountIds": + err = unpopulate(val, "StorageAccountIDs", &l.StorageAccountIDs) + 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 LinkedStorageAccountsResource. +func (l LinkedStorageAccountsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedStorageAccountsResource. +func (l *LinkedStorageAccountsResource) 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 "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + 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 LogAnalyticsQueryPack. +func (l LogAnalyticsQueryPack) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "location", l.Location) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "tags", l.Tags) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPack. +func (l *LogAnalyticsQueryPack) 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 "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &l.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + 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 LogAnalyticsQueryPackListResult. +func (l LogAnalyticsQueryPackListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackListResult. +func (l *LogAnalyticsQueryPackListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + 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 LogAnalyticsQueryPackProperties. +func (l LogAnalyticsQueryPackProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "queryPackId", l.QueryPackID) + populateTimeRFC3339(objectMap, "timeCreated", l.TimeCreated) + populateTimeRFC3339(objectMap, "timeModified", l.TimeModified) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackProperties. +func (l *LogAnalyticsQueryPackProperties) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "queryPackId": + err = unpopulate(val, "QueryPackID", &l.QueryPackID) + delete(rawMsg, key) + case "timeCreated": + err = unpopulateTimeRFC3339(val, "TimeCreated", &l.TimeCreated) + delete(rawMsg, key) + case "timeModified": + err = unpopulateTimeRFC3339(val, "TimeModified", &l.TimeModified) + 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 LogAnalyticsQueryPackQuery. +func (l LogAnalyticsQueryPackQuery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackQuery. +func (l *LogAnalyticsQueryPackQuery) 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 "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + 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 LogAnalyticsQueryPackQueryListResult. +func (l LogAnalyticsQueryPackQueryListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackQueryListResult. +func (l *LogAnalyticsQueryPackQueryListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + 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 LogAnalyticsQueryPackQueryProperties. +func (l LogAnalyticsQueryPackQueryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "author", l.Author) + populate(objectMap, "body", l.Body) + populate(objectMap, "description", l.Description) + populate(objectMap, "displayName", l.DisplayName) + populate(objectMap, "id", l.ID) + populate(objectMap, "properties", &l.Properties) + populate(objectMap, "related", l.Related) + populate(objectMap, "tags", l.Tags) + populateTimeRFC3339(objectMap, "timeCreated", l.TimeCreated) + populateTimeRFC3339(objectMap, "timeModified", l.TimeModified) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackQueryProperties. +func (l *LogAnalyticsQueryPackQueryProperties) 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 "author": + err = unpopulate(val, "Author", &l.Author) + delete(rawMsg, key) + case "body": + err = unpopulate(val, "Body", &l.Body) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &l.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &l.DisplayName) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "related": + err = unpopulate(val, "Related", &l.Related) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + case "timeCreated": + err = unpopulateTimeRFC3339(val, "TimeCreated", &l.TimeCreated) + delete(rawMsg, key) + case "timeModified": + err = unpopulateTimeRFC3339(val, "TimeModified", &l.TimeModified) + 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 LogAnalyticsQueryPackQueryPropertiesRelated. +func (l LogAnalyticsQueryPackQueryPropertiesRelated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "categories", l.Categories) + populate(objectMap, "resourceTypes", l.ResourceTypes) + populate(objectMap, "solutions", l.Solutions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackQueryPropertiesRelated. +func (l *LogAnalyticsQueryPackQueryPropertiesRelated) 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 "categories": + err = unpopulate(val, "Categories", &l.Categories) + delete(rawMsg, key) + case "resourceTypes": + err = unpopulate(val, "ResourceTypes", &l.ResourceTypes) + delete(rawMsg, key) + case "solutions": + err = unpopulate(val, "Solutions", &l.Solutions) + 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 LogAnalyticsQueryPackQuerySearchProperties. +func (l LogAnalyticsQueryPackQuerySearchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "related", l.Related) + populate(objectMap, "tags", l.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackQuerySearchProperties. +func (l *LogAnalyticsQueryPackQuerySearchProperties) 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 "related": + err = unpopulate(val, "Related", &l.Related) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + 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 LogAnalyticsQueryPackQuerySearchPropertiesRelated. +func (l LogAnalyticsQueryPackQuerySearchPropertiesRelated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "categories", l.Categories) + populate(objectMap, "resourceTypes", l.ResourceTypes) + populate(objectMap, "solutions", l.Solutions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackQuerySearchPropertiesRelated. +func (l *LogAnalyticsQueryPackQuerySearchPropertiesRelated) 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 "categories": + err = unpopulate(val, "Categories", &l.Categories) + delete(rawMsg, key) + case "resourceTypes": + err = unpopulate(val, "ResourceTypes", &l.ResourceTypes) + delete(rawMsg, key) + case "solutions": + err = unpopulate(val, "Solutions", &l.Solutions) + 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 ManagementGroup. +func (m ManagementGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", m.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroup. +func (m *ManagementGroup) 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 "properties": + err = unpopulate(val, "Properties", &m.Properties) + 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 ManagementGroupProperties. +func (m ManagementGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "created", m.Created) + populateTimeRFC3339(objectMap, "dataReceived", m.DataReceived) + populate(objectMap, "id", m.ID) + populate(objectMap, "isGateway", m.IsGateway) + populate(objectMap, "name", m.Name) + populate(objectMap, "sku", m.SKU) + populate(objectMap, "serverCount", m.ServerCount) + populate(objectMap, "version", m.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroupProperties. +func (m *ManagementGroupProperties) 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 "created": + err = unpopulateTimeRFC3339(val, "Created", &m.Created) + delete(rawMsg, key) + case "dataReceived": + err = unpopulateTimeRFC3339(val, "DataReceived", &m.DataReceived) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "isGateway": + err = unpopulate(val, "IsGateway", &m.IsGateway) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) + delete(rawMsg, key) + case "serverCount": + err = unpopulate(val, "ServerCount", &m.ServerCount) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &m.Version) + 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 MetricName. +func (m MetricName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "localizedValue", m.LocalizedValue) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricName. +func (m *MetricName) 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 "localizedValue": + err = unpopulate(val, "LocalizedValue", &m.LocalizedValue) + 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 Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + 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 "name": + err = unpopulate(val, "Name", &o.Name) + 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]interface{}) + 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 OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) 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 OperationStatus. +func (o OperationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endTime", o.EndTime) + populate(objectMap, "error", o.Error) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "startTime", o.StartTime) + populate(objectMap, "status", o.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus. +func (o *OperationStatus) 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 "endTime": + err = unpopulate(val, "EndTime", &o.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &o.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &o.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) + 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 PrivateLinkScopedResource. +func (p PrivateLinkScopedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "resourceId", p.ResourceID) + populate(objectMap, "scopeId", p.ScopeID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkScopedResource. +func (p *PrivateLinkScopedResource) 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 "resourceId": + err = unpopulate(val, "ResourceID", &p.ResourceID) + delete(rawMsg, key) + case "scopeId": + err = unpopulate(val, "ScopeID", &p.ScopeID) + 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 ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) 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 "name": + err = unpopulate(val, "Name", &p.Name) + 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 QueryPacksResource. +func (q QueryPacksResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", q.ID) + populate(objectMap, "location", q.Location) + populate(objectMap, "name", q.Name) + populate(objectMap, "tags", q.Tags) + populate(objectMap, "type", q.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryPacksResource. +func (q *QueryPacksResource) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &q.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &q.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &q.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &q.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &q.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) 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 "name": + err = unpopulate(val, "Name", &r.Name) + 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 RestoredLogs. +func (r RestoredLogs) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endRestoreTime", r.EndRestoreTime) + populate(objectMap, "sourceTable", r.SourceTable) + populateTimeRFC3339(objectMap, "startRestoreTime", r.StartRestoreTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestoredLogs. +func (r *RestoredLogs) 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 "endRestoreTime": + err = unpopulateTimeRFC3339(val, "EndRestoreTime", &r.EndRestoreTime) + delete(rawMsg, key) + case "sourceTable": + err = unpopulate(val, "SourceTable", &r.SourceTable) + delete(rawMsg, key) + case "startRestoreTime": + err = unpopulateTimeRFC3339(val, "StartRestoreTime", &r.StartRestoreTime) + 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 ResultStatistics. +func (r ResultStatistics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ingestedRecords", r.IngestedRecords) + populate(objectMap, "progress", r.Progress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResultStatistics. +func (r *ResultStatistics) 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 "ingestedRecords": + err = unpopulate(val, "IngestedRecords", &r.IngestedRecords) + delete(rawMsg, key) + case "progress": + err = unpopulate(val, "Progress", &r.Progress) + 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 SavedSearch. +func (s SavedSearch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", s.Etag) + 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 SavedSearch. +func (s *SavedSearch) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, 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 SavedSearchProperties. +func (s SavedSearchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "category", s.Category) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "functionAlias", s.FunctionAlias) + populate(objectMap, "functionParameters", s.FunctionParameters) + populate(objectMap, "query", s.Query) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SavedSearchProperties. +func (s *SavedSearchProperties) 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 "category": + err = unpopulate(val, "Category", &s.Category) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "functionAlias": + err = unpopulate(val, "FunctionAlias", &s.FunctionAlias) + delete(rawMsg, key) + case "functionParameters": + err = unpopulate(val, "FunctionParameters", &s.FunctionParameters) + delete(rawMsg, key) + case "query": + err = unpopulate(val, "Query", &s.Query) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + 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 SavedSearchesListResult. +func (s SavedSearchesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SavedSearchesListResult. +func (s *SavedSearchesListResult) 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 "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 Schema. +func (s Schema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "categories", s.Categories) + populate(objectMap, "columns", s.Columns) + populate(objectMap, "description", s.Description) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "labels", s.Labels) + populate(objectMap, "name", s.Name) + populate(objectMap, "restoredLogs", s.RestoredLogs) + populate(objectMap, "searchResults", s.SearchResults) + populate(objectMap, "solutions", s.Solutions) + populate(objectMap, "source", s.Source) + populate(objectMap, "standardColumns", s.StandardColumns) + populate(objectMap, "tableSubType", s.TableSubType) + populate(objectMap, "tableType", s.TableType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Schema. +func (s *Schema) 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 "categories": + err = unpopulate(val, "Categories", &s.Categories) + delete(rawMsg, key) + case "columns": + err = unpopulate(val, "Columns", &s.Columns) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &s.Labels) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "restoredLogs": + err = unpopulate(val, "RestoredLogs", &s.RestoredLogs) + delete(rawMsg, key) + case "searchResults": + err = unpopulate(val, "SearchResults", &s.SearchResults) + delete(rawMsg, key) + case "solutions": + err = unpopulate(val, "Solutions", &s.Solutions) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &s.Source) + delete(rawMsg, key) + case "standardColumns": + err = unpopulate(val, "StandardColumns", &s.StandardColumns) + delete(rawMsg, key) + case "tableSubType": + err = unpopulate(val, "TableSubType", &s.TableSubType) + delete(rawMsg, key) + case "tableType": + err = unpopulate(val, "TableType", &s.TableType) + 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 SearchGetSchemaResponse. +func (s SearchGetSchemaResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metadata", s.Metadata) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SearchGetSchemaResponse. +func (s *SearchGetSchemaResponse) 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 "metadata": + err = unpopulate(val, "Metadata", &s.Metadata) + 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 SearchMetadata. +func (s SearchMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aggregatedGroupingFields", s.AggregatedGroupingFields) + populate(objectMap, "aggregatedValueField", s.AggregatedValueField) + populate(objectMap, "coreSummaries", s.CoreSummaries) + populate(objectMap, "eTag", s.ETag) + populate(objectMap, "id", s.ID) + populateTimeRFC3339(objectMap, "lastUpdated", s.LastUpdated) + populate(objectMap, "max", s.Max) + populate(objectMap, "requestTime", s.RequestTime) + populate(objectMap, "resultType", s.ResultType) + populate(objectMap, "schema", s.Schema) + populate(objectMap, "requestId", s.SearchID) + populate(objectMap, "sort", s.Sort) + populateTimeRFC3339(objectMap, "startTime", s.StartTime) + populate(objectMap, "status", s.Status) + populate(objectMap, "sum", s.Sum) + populate(objectMap, "top", s.Top) + populate(objectMap, "total", s.Total) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SearchMetadata. +func (s *SearchMetadata) 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 "aggregatedGroupingFields": + err = unpopulate(val, "AggregatedGroupingFields", &s.AggregatedGroupingFields) + delete(rawMsg, key) + case "aggregatedValueField": + err = unpopulate(val, "AggregatedValueField", &s.AggregatedValueField) + delete(rawMsg, key) + case "coreSummaries": + err = unpopulate(val, "CoreSummaries", &s.CoreSummaries) + delete(rawMsg, key) + case "eTag": + err = unpopulate(val, "ETag", &s.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "lastUpdated": + err = unpopulateTimeRFC3339(val, "LastUpdated", &s.LastUpdated) + delete(rawMsg, key) + case "max": + err = unpopulate(val, "Max", &s.Max) + delete(rawMsg, key) + case "requestTime": + err = unpopulate(val, "RequestTime", &s.RequestTime) + delete(rawMsg, key) + case "resultType": + err = unpopulate(val, "ResultType", &s.ResultType) + delete(rawMsg, key) + case "schema": + err = unpopulate(val, "Schema", &s.Schema) + delete(rawMsg, key) + case "requestId": + err = unpopulate(val, "SearchID", &s.SearchID) + delete(rawMsg, key) + case "sort": + err = unpopulate(val, "Sort", &s.Sort) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &s.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "sum": + err = unpopulate(val, "Sum", &s.Sum) + delete(rawMsg, key) + case "top": + err = unpopulate(val, "Top", &s.Top) + delete(rawMsg, key) + case "total": + err = unpopulate(val, "Total", &s.Total) + 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 SearchMetadataSchema. +func (s SearchMetadataSchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", s.Name) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SearchMetadataSchema. +func (s *SearchMetadataSchema) 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 "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 SearchResults. +func (s SearchResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", s.Description) + populateTimeRFC3339(objectMap, "endSearchTime", s.EndSearchTime) + populate(objectMap, "limit", s.Limit) + populate(objectMap, "query", s.Query) + populate(objectMap, "sourceTable", s.SourceTable) + populateTimeRFC3339(objectMap, "startSearchTime", s.StartSearchTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SearchResults. +func (s *SearchResults) 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 "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "endSearchTime": + err = unpopulateTimeRFC3339(val, "EndSearchTime", &s.EndSearchTime) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &s.Limit) + delete(rawMsg, key) + case "query": + err = unpopulate(val, "Query", &s.Query) + delete(rawMsg, key) + case "sourceTable": + err = unpopulate(val, "SourceTable", &s.SourceTable) + delete(rawMsg, key) + case "startSearchTime": + err = unpopulateTimeRFC3339(val, "StartSearchTime", &s.StartSearchTime) + 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 SearchSchemaValue. +func (s SearchSchemaValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "facet", s.Facet) + populate(objectMap, "indexed", s.Indexed) + populate(objectMap, "name", s.Name) + populate(objectMap, "ownerType", s.OwnerType) + populate(objectMap, "stored", s.Stored) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SearchSchemaValue. +func (s *SearchSchemaValue) 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 "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "facet": + err = unpopulate(val, "Facet", &s.Facet) + delete(rawMsg, key) + case "indexed": + err = unpopulate(val, "Indexed", &s.Indexed) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "ownerType": + err = unpopulate(val, "OwnerType", &s.OwnerType) + delete(rawMsg, key) + case "stored": + err = unpopulate(val, "Stored", &s.Stored) + 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 SearchSort. +func (s SearchSort) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", s.Name) + populate(objectMap, "order", s.Order) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SearchSort. +func (s *SearchSort) 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 "order": + err = unpopulate(val, "Order", &s.Order) + 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 SharedKeys. +func (s SharedKeys) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "primarySharedKey", s.PrimarySharedKey) + populate(objectMap, "secondarySharedKey", s.SecondarySharedKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedKeys. +func (s *SharedKeys) 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 "primarySharedKey": + err = unpopulate(val, "PrimarySharedKey", &s.PrimarySharedKey) + delete(rawMsg, key) + case "secondarySharedKey": + err = unpopulate(val, "SecondarySharedKey", &s.SecondarySharedKey) + 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]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "key", s.Key) + 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 "key": + err = unpopulate(val, "Key", &s.Key) + 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 StorageInsight. +func (s StorageInsight) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", s.ETag) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageInsight. +func (s *StorageInsight) 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 "eTag": + err = unpopulate(val, "ETag", &s.ETag) + delete(rawMsg, 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 "tags": + err = unpopulate(val, "Tags", &s.Tags) + 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 StorageInsightListResult. +func (s StorageInsightListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "@odata.nextLink", s.ODataNextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageInsightListResult. +func (s *StorageInsightListResult) 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 "@odata.nextLink": + err = unpopulate(val, "ODataNextLink", &s.ODataNextLink) + 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 StorageInsightProperties. +func (s StorageInsightProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "containers", s.Containers) + populate(objectMap, "status", s.Status) + populate(objectMap, "storageAccount", s.StorageAccount) + populate(objectMap, "tables", s.Tables) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageInsightProperties. +func (s *StorageInsightProperties) 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 "containers": + err = unpopulate(val, "Containers", &s.Containers) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "storageAccount": + err = unpopulate(val, "StorageAccount", &s.StorageAccount) + delete(rawMsg, key) + case "tables": + err = unpopulate(val, "Tables", &s.Tables) + 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 StorageInsightStatus. +func (s StorageInsightStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", s.Description) + populate(objectMap, "state", s.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageInsightStatus. +func (s *StorageInsightStatus) 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 "description": + err = unpopulate(val, "Description", &s.Description) + 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 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 +} + +// MarshalJSON implements the json.Marshaller interface for type SystemDataAutoGenerated. +func (s SystemDataAutoGenerated) 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 SystemDataAutoGenerated. +func (s *SystemDataAutoGenerated) 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 Table. +func (t Table) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Table. +func (t *Table) 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 "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 TableProperties. +func (t TableProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "archiveRetentionInDays", t.ArchiveRetentionInDays) + populate(objectMap, "lastPlanModifiedDate", t.LastPlanModifiedDate) + populate(objectMap, "plan", t.Plan) + populate(objectMap, "provisioningState", t.ProvisioningState) + populate(objectMap, "restoredLogs", t.RestoredLogs) + populate(objectMap, "resultStatistics", t.ResultStatistics) + populate(objectMap, "retentionInDays", t.RetentionInDays) + populate(objectMap, "schema", t.Schema) + populate(objectMap, "searchResults", t.SearchResults) + populate(objectMap, "totalRetentionInDays", t.TotalRetentionInDays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TableProperties. +func (t *TableProperties) 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 "archiveRetentionInDays": + err = unpopulate(val, "ArchiveRetentionInDays", &t.ArchiveRetentionInDays) + delete(rawMsg, key) + case "lastPlanModifiedDate": + err = unpopulate(val, "LastPlanModifiedDate", &t.LastPlanModifiedDate) + delete(rawMsg, key) + case "plan": + err = unpopulate(val, "Plan", &t.Plan) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &t.ProvisioningState) + delete(rawMsg, key) + case "restoredLogs": + err = unpopulate(val, "RestoredLogs", &t.RestoredLogs) + delete(rawMsg, key) + case "resultStatistics": + err = unpopulate(val, "ResultStatistics", &t.ResultStatistics) + delete(rawMsg, key) + case "retentionInDays": + err = unpopulate(val, "RetentionInDays", &t.RetentionInDays) + delete(rawMsg, key) + case "schema": + err = unpopulate(val, "Schema", &t.Schema) + delete(rawMsg, key) + case "searchResults": + err = unpopulate(val, "SearchResults", &t.SearchResults) + delete(rawMsg, key) + case "totalRetentionInDays": + err = unpopulate(val, "TotalRetentionInDays", &t.TotalRetentionInDays) + 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 TablesListResult. +func (t TablesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TablesListResult. +func (t *TablesListResult) 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 "value": + err = unpopulate(val, "Value", &t.Value) + 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 Tag. +func (t Tag) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", t.Name) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Tag. +func (t *Tag) 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 "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + 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 TagsResource. +func (t TagsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", t.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagsResource. +func (t *TagsResource) 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 "tags": + err = unpopulate(val, "Tags", &t.Tags) + 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 TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) 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 "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + 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 UsageMetric. +func (u UsageMetric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentValue", u.CurrentValue) + populate(objectMap, "limit", u.Limit) + populate(objectMap, "name", u.Name) + populateTimeRFC3339(objectMap, "nextResetTime", u.NextResetTime) + populate(objectMap, "quotaPeriod", u.QuotaPeriod) + populate(objectMap, "unit", u.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UsageMetric. +func (u *UsageMetric) 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 "currentValue": + err = unpopulate(val, "CurrentValue", &u.CurrentValue) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &u.Limit) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "nextResetTime": + err = unpopulateTimeRFC3339(val, "NextResetTime", &u.NextResetTime) + delete(rawMsg, key) + case "quotaPeriod": + err = unpopulate(val, "QuotaPeriod", &u.QuotaPeriod) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &u.Unit) + 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 UserIdentityProperties. +func (u UserIdentityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentityProperties. +func (u *UserIdentityProperties) 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 "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + 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 Workspace. +func (w Workspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", w.ETag) + populate(objectMap, "id", w.ID) + populate(objectMap, "location", w.Location) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) + populate(objectMap, "tags", w.Tags) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Workspace. +func (w *Workspace) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "eTag": + err = unpopulate(val, "ETag", &w.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &w.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceCapping. +func (w WorkspaceCapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dailyQuotaGb", w.DailyQuotaGb) + populate(objectMap, "dataIngestionStatus", w.DataIngestionStatus) + populate(objectMap, "quotaNextResetTime", w.QuotaNextResetTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceCapping. +func (w *WorkspaceCapping) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dailyQuotaGb": + err = unpopulate(val, "DailyQuotaGb", &w.DailyQuotaGb) + delete(rawMsg, key) + case "dataIngestionStatus": + err = unpopulate(val, "DataIngestionStatus", &w.DataIngestionStatus) + delete(rawMsg, key) + case "quotaNextResetTime": + err = unpopulate(val, "QuotaNextResetTime", &w.QuotaNextResetTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceFeatures. +func (w WorkspaceFeatures) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clusterResourceId", w.ClusterResourceID) + populate(objectMap, "disableLocalAuth", w.DisableLocalAuth) + populate(objectMap, "enableDataExport", w.EnableDataExport) + populate(objectMap, "enableLogAccessUsingOnlyResourcePermissions", w.EnableLogAccessUsingOnlyResourcePermissions) + populate(objectMap, "immediatePurgeDataOn30Days", w.ImmediatePurgeDataOn30Days) + if w.AdditionalProperties != nil { + for key, val := range w.AdditionalProperties { + objectMap[key] = val + } + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceFeatures. +func (w *WorkspaceFeatures) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clusterResourceId": + err = unpopulate(val, "ClusterResourceID", &w.ClusterResourceID) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &w.DisableLocalAuth) + delete(rawMsg, key) + case "enableDataExport": + err = unpopulate(val, "EnableDataExport", &w.EnableDataExport) + delete(rawMsg, key) + case "enableLogAccessUsingOnlyResourcePermissions": + err = unpopulate(val, "EnableLogAccessUsingOnlyResourcePermissions", &w.EnableLogAccessUsingOnlyResourcePermissions) + delete(rawMsg, key) + case "immediatePurgeDataOn30Days": + err = unpopulate(val, "ImmediatePurgeDataOn30Days", &w.ImmediatePurgeDataOn30Days) + delete(rawMsg, key) + default: + if w.AdditionalProperties == nil { + w.AdditionalProperties = map[string]interface{}{} + } + if val != nil { + var aux interface{} + err = json.Unmarshal(val, &aux) + w.AdditionalProperties[key] = aux + } + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceListManagementGroupsResult. +func (w WorkspaceListManagementGroupsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceListManagementGroupsResult. +func (w *WorkspaceListManagementGroupsResult) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceListResult. +func (w WorkspaceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceListResult. +func (w *WorkspaceListResult) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceListUsagesResult. +func (w WorkspaceListUsagesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceListUsagesResult. +func (w *WorkspaceListUsagesResult) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspacePatch. +func (w WorkspacePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", w.Etag) + populate(objectMap, "id", w.ID) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "tags", w.Tags) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspacePatch. +func (w *WorkspacePatch) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &w.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceProperties. +func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "createdDate", w.CreatedDate) + populate(objectMap, "customerId", w.CustomerID) + populate(objectMap, "defaultDataCollectionRuleResourceId", w.DefaultDataCollectionRuleResourceID) + populate(objectMap, "features", w.Features) + populate(objectMap, "forceCmkForQuery", w.ForceCmkForQuery) + populate(objectMap, "modifiedDate", w.ModifiedDate) + populate(objectMap, "privateLinkScopedResources", w.PrivateLinkScopedResources) + populate(objectMap, "provisioningState", w.ProvisioningState) + populate(objectMap, "publicNetworkAccessForIngestion", w.PublicNetworkAccessForIngestion) + populate(objectMap, "publicNetworkAccessForQuery", w.PublicNetworkAccessForQuery) + populate(objectMap, "retentionInDays", w.RetentionInDays) + populate(objectMap, "sku", w.SKU) + populate(objectMap, "workspaceCapping", w.WorkspaceCapping) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceProperties. +func (w *WorkspaceProperties) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdDate": + err = unpopulate(val, "CreatedDate", &w.CreatedDate) + delete(rawMsg, key) + case "customerId": + err = unpopulate(val, "CustomerID", &w.CustomerID) + delete(rawMsg, key) + case "defaultDataCollectionRuleResourceId": + err = unpopulate(val, "DefaultDataCollectionRuleResourceID", &w.DefaultDataCollectionRuleResourceID) + delete(rawMsg, key) + case "features": + err = unpopulate(val, "Features", &w.Features) + delete(rawMsg, key) + case "forceCmkForQuery": + err = unpopulate(val, "ForceCmkForQuery", &w.ForceCmkForQuery) + delete(rawMsg, key) + case "modifiedDate": + err = unpopulate(val, "ModifiedDate", &w.ModifiedDate) + delete(rawMsg, key) + case "privateLinkScopedResources": + err = unpopulate(val, "PrivateLinkScopedResources", &w.PrivateLinkScopedResources) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) + delete(rawMsg, key) + case "publicNetworkAccessForIngestion": + err = unpopulate(val, "PublicNetworkAccessForIngestion", &w.PublicNetworkAccessForIngestion) + delete(rawMsg, key) + case "publicNetworkAccessForQuery": + err = unpopulate(val, "PublicNetworkAccessForQuery", &w.PublicNetworkAccessForQuery) + delete(rawMsg, key) + case "retentionInDays": + err = unpopulate(val, "RetentionInDays", &w.RetentionInDays) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &w.SKU) + delete(rawMsg, key) + case "workspaceCapping": + err = unpopulate(val, "WorkspaceCapping", &w.WorkspaceCapping) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspacePurgeBody. +func (w WorkspacePurgeBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "filters", w.Filters) + populate(objectMap, "table", w.Table) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspacePurgeBody. +func (w *WorkspacePurgeBody) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "filters": + err = unpopulate(val, "Filters", &w.Filters) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &w.Table) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspacePurgeBodyFilters. +func (w WorkspacePurgeBodyFilters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "column", w.Column) + populate(objectMap, "key", w.Key) + populate(objectMap, "operator", w.Operator) + populate(objectMap, "value", &w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspacePurgeBodyFilters. +func (w *WorkspacePurgeBodyFilters) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "column": + err = unpopulate(val, "Column", &w.Column) + delete(rawMsg, key) + case "key": + err = unpopulate(val, "Key", &w.Key) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &w.Operator) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspacePurgeResponse. +func (w WorkspacePurgeResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "operationId", w.OperationID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspacePurgeResponse. +func (w *WorkspacePurgeResponse) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "operationId": + err = unpopulate(val, "OperationID", &w.OperationID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspacePurgeStatusResponse. +func (w WorkspacePurgeStatusResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "status", w.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspacePurgeStatusResponse. +func (w *WorkspacePurgeStatusResponse) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "status": + err = unpopulate(val, "Status", &w.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceSKU. +func (w WorkspaceSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacityReservationLevel", w.CapacityReservationLevel) + populate(objectMap, "lastSkuUpdate", w.LastSKUUpdate) + populate(objectMap, "name", w.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceSKU. +func (w *WorkspaceSKU) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacityReservationLevel": + err = unpopulate(val, "CapacityReservationLevel", &w.CapacityReservationLevel) + delete(rawMsg, key) + case "lastSkuUpdate": + err = unpopulate(val, "LastSKUUpdate", &w.LastSKUUpdate) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +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 +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_operations_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/operations_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_operations_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/operations_client.go index d2e005a0a504..13c6c0a11188 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_operations_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/operations_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_operations_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/operations_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_operationstatuses_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/operationstatuses_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_operationstatuses_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/operationstatuses_client.go index 41ed610dd488..2c1028f2456a 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_operationstatuses_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/operationstatuses_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_operationstatuses_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/operationstatuses_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_operationstatuses_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/operationstatuses_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_queries_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/queries_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_queries_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/queries_client.go index f0588f691a32..2c40b4565555 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_queries_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/queries_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_queries_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/queries_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_queries_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/queries_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_querypacks_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/querypacks_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_querypacks_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/querypacks_client.go index 2fa7023cca9f..5c3514ca11a5 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_querypacks_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/querypacks_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_querypacks_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/querypacks_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_querypacks_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/querypacks_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_response_types.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/response_types.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_response_types.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/response_types.go index 2527d18a69ce..b2a911b948c0 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_response_types.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/response_types.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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_savedsearches_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/savedsearches_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_savedsearches_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/savedsearches_client.go index d41dff9c1107..41086181be69 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_savedsearches_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/savedsearches_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_savedsearches_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/savedsearches_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_savedsearches_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/savedsearches_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_schema_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/schema_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_schema_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/schema_client.go index 987cd6d481c3..6f9edbcf25e4 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_schema_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/schema_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_schema_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/schema_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_schema_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/schema_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_sharedkeys_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/sharedkeys_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_sharedkeys_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/sharedkeys_client.go index e9295247a964..7fad88f7f5dc 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_sharedkeys_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/sharedkeys_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_sharedkeys_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/sharedkeys_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_sharedkeys_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/sharedkeys_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_storageinsightconfigs_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/storageinsightconfigs_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_storageinsightconfigs_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/storageinsightconfigs_client.go index 780a20b27c4a..b350e40ffed4 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_storageinsightconfigs_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/storageinsightconfigs_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_storageinsightconfigs_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/storageinsightconfigs_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_storageinsightconfigs_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/storageinsightconfigs_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_tables_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/tables_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_tables_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/tables_client.go index 8ed0ab767aea..3c44b4da6d9a 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_tables_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/tables_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_tables_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/tables_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_tables_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/tables_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_time_rfc3339.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/time_rfc3339.go index fc4d49ce14f7..dff3b7a312c6 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_usages_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/usages_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_usages_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/usages_client.go index a12c7adc9c1b..9c29559461da 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_usages_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/usages_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_usages_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/usages_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_usages_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/usages_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_workspacepurge_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspacepurge_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_workspacepurge_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/workspacepurge_client.go index 6238100a9098..7297161a73a7 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_workspacepurge_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspacepurge_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_workspacepurge_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspacepurge_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_workspacepurge_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/workspacepurge_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_workspaces_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspaces_client.go similarity index 99% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_workspaces_client.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/workspaces_client.go index 7d9bc61806ca..342a3f3cc7d0 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_workspaces_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspaces_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 armoperationalinsights diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_workspaces_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspaces_client_example_test.go similarity index 100% rename from sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_workspaces_client_test.go rename to sdk/resourcemanager/operationalinsights/armoperationalinsights/workspaces_client_example_test.go diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models_serde.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models_serde.go deleted file mode 100644 index 8e1951de4ec1..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models_serde.go +++ /dev/null @@ -1,806 +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 armoperationalinsights - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type Cluster. -func (c Cluster) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ClusterPatch. -func (c ClusterPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "tags", c.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ClusterProperties. -func (c ClusterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "associatedWorkspaces", c.AssociatedWorkspaces) - populate(objectMap, "billingType", c.BillingType) - populate(objectMap, "capacityReservationProperties", c.CapacityReservationProperties) - populate(objectMap, "clusterId", c.ClusterID) - populate(objectMap, "createdDate", c.CreatedDate) - populate(objectMap, "isAvailabilityZonesEnabled", c.IsAvailabilityZonesEnabled) - populate(objectMap, "isDoubleEncryptionEnabled", c.IsDoubleEncryptionEnabled) - populate(objectMap, "keyVaultProperties", c.KeyVaultProperties) - populate(objectMap, "lastModifiedDate", c.LastModifiedDate) - populate(objectMap, "provisioningState", c.ProvisioningState) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DataExportProperties. -func (d DataExportProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "createdDate", d.CreatedDate) - populate(objectMap, "dataExportId", d.DataExportID) - populate(objectMap, "destination", d.Destination) - populate(objectMap, "enable", d.Enable) - populate(objectMap, "lastModifiedDate", d.LastModifiedDate) - populate(objectMap, "tableNames", d.TableNames) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DataSource. -func (d DataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", d.Etag) - populate(objectMap, "id", d.ID) - populate(objectMap, "kind", d.Kind) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", &d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Identity. -func (i Identity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", i.PrincipalID) - populate(objectMap, "tenantId", i.TenantID) - populate(objectMap, "type", i.Type) - populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LinkedService. -func (l LinkedService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "tags", l.Tags) - populate(objectMap, "type", l.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LinkedStorageAccountsProperties. -func (l LinkedStorageAccountsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataSourceType", l.DataSourceType) - populate(objectMap, "storageAccountIds", l.StorageAccountIDs) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPack. -func (l LogAnalyticsQueryPack) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", l.ID) - populate(objectMap, "location", l.Location) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "tags", l.Tags) - populate(objectMap, "type", l.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackProperties. -func (l LogAnalyticsQueryPackProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", l.ProvisioningState) - populate(objectMap, "queryPackId", l.QueryPackID) - populateTimeRFC3339(objectMap, "timeCreated", l.TimeCreated) - populateTimeRFC3339(objectMap, "timeModified", l.TimeModified) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackProperties. -func (l *LogAnalyticsQueryPackProperties) 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 "provisioningState": - err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) - delete(rawMsg, key) - case "queryPackId": - err = unpopulate(val, "QueryPackID", &l.QueryPackID) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateTimeRFC3339(val, "TimeCreated", &l.TimeCreated) - delete(rawMsg, key) - case "timeModified": - err = unpopulateTimeRFC3339(val, "TimeModified", &l.TimeModified) - 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 LogAnalyticsQueryPackQuery. -func (l LogAnalyticsQueryPackQuery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "systemData", l.SystemData) - populate(objectMap, "type", l.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackQueryProperties. -func (l LogAnalyticsQueryPackQueryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "author", l.Author) - populate(objectMap, "body", l.Body) - populate(objectMap, "description", l.Description) - populate(objectMap, "displayName", l.DisplayName) - populate(objectMap, "id", l.ID) - populate(objectMap, "properties", &l.Properties) - populate(objectMap, "related", l.Related) - populate(objectMap, "tags", l.Tags) - populateTimeRFC3339(objectMap, "timeCreated", l.TimeCreated) - populateTimeRFC3339(objectMap, "timeModified", l.TimeModified) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackQueryProperties. -func (l *LogAnalyticsQueryPackQueryProperties) 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 "author": - err = unpopulate(val, "Author", &l.Author) - delete(rawMsg, key) - case "body": - err = unpopulate(val, "Body", &l.Body) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &l.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &l.DisplayName) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &l.ID) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) - case "related": - err = unpopulate(val, "Related", &l.Related) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &l.Tags) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateTimeRFC3339(val, "TimeCreated", &l.TimeCreated) - delete(rawMsg, key) - case "timeModified": - err = unpopulateTimeRFC3339(val, "TimeModified", &l.TimeModified) - 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 LogAnalyticsQueryPackQueryPropertiesRelated. -func (l LogAnalyticsQueryPackQueryPropertiesRelated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "categories", l.Categories) - populate(objectMap, "resourceTypes", l.ResourceTypes) - populate(objectMap, "solutions", l.Solutions) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackQuerySearchProperties. -func (l LogAnalyticsQueryPackQuerySearchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "related", l.Related) - populate(objectMap, "tags", l.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackQuerySearchPropertiesRelated. -func (l LogAnalyticsQueryPackQuerySearchPropertiesRelated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "categories", l.Categories) - populate(objectMap, "resourceTypes", l.ResourceTypes) - populate(objectMap, "solutions", l.Solutions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroupProperties. -func (m *ManagementGroupProperties) 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 "created": - err = unpopulateTimeRFC3339(val, "Created", &m.Created) - delete(rawMsg, key) - case "dataReceived": - err = unpopulateTimeRFC3339(val, "DataReceived", &m.DataReceived) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "isGateway": - err = unpopulate(val, "IsGateway", &m.IsGateway) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &m.SKU) - delete(rawMsg, key) - case "serverCount": - err = unpopulate(val, "ServerCount", &m.ServerCount) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &m.Version) - 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 QueryPacksResource. -func (q QueryPacksResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", q.ID) - populate(objectMap, "location", q.Location) - populate(objectMap, "name", q.Name) - populate(objectMap, "tags", q.Tags) - populate(objectMap, "type", q.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RestoredLogs. -func (r RestoredLogs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endRestoreTime", r.EndRestoreTime) - populate(objectMap, "sourceTable", r.SourceTable) - populateTimeRFC3339(objectMap, "startRestoreTime", r.StartRestoreTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestoredLogs. -func (r *RestoredLogs) 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 "endRestoreTime": - err = unpopulateTimeRFC3339(val, "EndRestoreTime", &r.EndRestoreTime) - delete(rawMsg, key) - case "sourceTable": - err = unpopulate(val, "SourceTable", &r.SourceTable) - delete(rawMsg, key) - case "startRestoreTime": - err = unpopulateTimeRFC3339(val, "StartRestoreTime", &r.StartRestoreTime) - 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 SavedSearchProperties. -func (s SavedSearchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "category", s.Category) - populate(objectMap, "displayName", s.DisplayName) - populate(objectMap, "functionAlias", s.FunctionAlias) - populate(objectMap, "functionParameters", s.FunctionParameters) - populate(objectMap, "query", s.Query) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "version", s.Version) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Schema. -func (s Schema) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "categories", s.Categories) - populate(objectMap, "columns", s.Columns) - populate(objectMap, "description", s.Description) - populate(objectMap, "displayName", s.DisplayName) - populate(objectMap, "labels", s.Labels) - populate(objectMap, "name", s.Name) - populate(objectMap, "restoredLogs", s.RestoredLogs) - populate(objectMap, "searchResults", s.SearchResults) - populate(objectMap, "solutions", s.Solutions) - populate(objectMap, "source", s.Source) - populate(objectMap, "standardColumns", s.StandardColumns) - populate(objectMap, "tableSubType", s.TableSubType) - populate(objectMap, "tableType", s.TableType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SearchMetadata. -func (s *SearchMetadata) 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 "aggregatedGroupingFields": - err = unpopulate(val, "AggregatedGroupingFields", &s.AggregatedGroupingFields) - delete(rawMsg, key) - case "aggregatedValueField": - err = unpopulate(val, "AggregatedValueField", &s.AggregatedValueField) - delete(rawMsg, key) - case "coreSummaries": - err = unpopulate(val, "CoreSummaries", &s.CoreSummaries) - delete(rawMsg, key) - case "eTag": - err = unpopulate(val, "ETag", &s.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "lastUpdated": - err = unpopulateTimeRFC3339(val, "LastUpdated", &s.LastUpdated) - delete(rawMsg, key) - case "max": - err = unpopulate(val, "Max", &s.Max) - delete(rawMsg, key) - case "requestTime": - err = unpopulate(val, "RequestTime", &s.RequestTime) - delete(rawMsg, key) - case "resultType": - err = unpopulate(val, "ResultType", &s.ResultType) - delete(rawMsg, key) - case "schema": - err = unpopulate(val, "Schema", &s.Schema) - delete(rawMsg, key) - case "requestId": - err = unpopulate(val, "SearchID", &s.SearchID) - delete(rawMsg, key) - case "sort": - err = unpopulate(val, "Sort", &s.Sort) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &s.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) - delete(rawMsg, key) - case "sum": - err = unpopulate(val, "Sum", &s.Sum) - delete(rawMsg, key) - case "top": - err = unpopulate(val, "Top", &s.Top) - delete(rawMsg, key) - case "total": - err = unpopulate(val, "Total", &s.Total) - 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 SearchResults. -func (s SearchResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", s.Description) - populateTimeRFC3339(objectMap, "endSearchTime", s.EndSearchTime) - populate(objectMap, "limit", s.Limit) - populate(objectMap, "query", s.Query) - populate(objectMap, "sourceTable", s.SourceTable) - populateTimeRFC3339(objectMap, "startSearchTime", s.StartSearchTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SearchResults. -func (s *SearchResults) 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 "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "endSearchTime": - err = unpopulateTimeRFC3339(val, "EndSearchTime", &s.EndSearchTime) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &s.Limit) - delete(rawMsg, key) - case "query": - err = unpopulate(val, "Query", &s.Query) - delete(rawMsg, key) - case "sourceTable": - err = unpopulate(val, "SourceTable", &s.SourceTable) - delete(rawMsg, key) - case "startSearchTime": - err = unpopulateTimeRFC3339(val, "StartSearchTime", &s.StartSearchTime) - 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 StorageInsight. -func (s StorageInsight) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", s.ETag) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type StorageInsightProperties. -func (s StorageInsightProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "containers", s.Containers) - populate(objectMap, "status", s.Status) - populate(objectMap, "storageAccount", s.StorageAccount) - populate(objectMap, "tables", s.Tables) - return json.Marshal(objectMap) -} - -// 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 -} - -// MarshalJSON implements the json.Marshaller interface for type SystemDataAutoGenerated. -func (s SystemDataAutoGenerated) 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 SystemDataAutoGenerated. -func (s *SystemDataAutoGenerated) 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 Table. -func (t Table) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "name", t.Name) - populate(objectMap, "properties", t.Properties) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TagsResource. -func (t TagsResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", t.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UsageMetric. -func (u *UsageMetric) 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 "currentValue": - err = unpopulate(val, "CurrentValue", &u.CurrentValue) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &u.Limit) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &u.Name) - delete(rawMsg, key) - case "nextResetTime": - err = unpopulateTimeRFC3339(val, "NextResetTime", &u.NextResetTime) - delete(rawMsg, key) - case "quotaPeriod": - err = unpopulate(val, "QuotaPeriod", &u.QuotaPeriod) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &u.Unit) - 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 Workspace. -func (w Workspace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", w.ETag) - populate(objectMap, "id", w.ID) - populate(objectMap, "location", w.Location) - populate(objectMap, "name", w.Name) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "systemData", w.SystemData) - populate(objectMap, "tags", w.Tags) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkspaceFeatures. -func (w WorkspaceFeatures) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clusterResourceId", w.ClusterResourceID) - populate(objectMap, "disableLocalAuth", w.DisableLocalAuth) - populate(objectMap, "enableDataExport", w.EnableDataExport) - populate(objectMap, "enableLogAccessUsingOnlyResourcePermissions", w.EnableLogAccessUsingOnlyResourcePermissions) - populate(objectMap, "immediatePurgeDataOn30Days", w.ImmediatePurgeDataOn30Days) - if w.AdditionalProperties != nil { - for key, val := range w.AdditionalProperties { - objectMap[key] = val - } - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceFeatures. -func (w *WorkspaceFeatures) 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", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clusterResourceId": - err = unpopulate(val, "ClusterResourceID", &w.ClusterResourceID) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &w.DisableLocalAuth) - delete(rawMsg, key) - case "enableDataExport": - err = unpopulate(val, "EnableDataExport", &w.EnableDataExport) - delete(rawMsg, key) - case "enableLogAccessUsingOnlyResourcePermissions": - err = unpopulate(val, "EnableLogAccessUsingOnlyResourcePermissions", &w.EnableLogAccessUsingOnlyResourcePermissions) - delete(rawMsg, key) - case "immediatePurgeDataOn30Days": - err = unpopulate(val, "ImmediatePurgeDataOn30Days", &w.ImmediatePurgeDataOn30Days) - delete(rawMsg, key) - default: - if w.AdditionalProperties == nil { - w.AdditionalProperties = map[string]interface{}{} - } - if val != nil { - var aux interface{} - err = json.Unmarshal(val, &aux) - w.AdditionalProperties[key] = aux - } - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WorkspacePatch. -func (w WorkspacePatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", w.Etag) - populate(objectMap, "id", w.ID) - populate(objectMap, "name", w.Name) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "tags", w.Tags) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkspaceProperties. -func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "createdDate", w.CreatedDate) - populate(objectMap, "customerId", w.CustomerID) - populate(objectMap, "defaultDataCollectionRuleResourceId", w.DefaultDataCollectionRuleResourceID) - populate(objectMap, "features", w.Features) - populate(objectMap, "forceCmkForQuery", w.ForceCmkForQuery) - populate(objectMap, "modifiedDate", w.ModifiedDate) - populate(objectMap, "privateLinkScopedResources", w.PrivateLinkScopedResources) - populate(objectMap, "provisioningState", w.ProvisioningState) - populate(objectMap, "publicNetworkAccessForIngestion", w.PublicNetworkAccessForIngestion) - populate(objectMap, "publicNetworkAccessForQuery", w.PublicNetworkAccessForQuery) - populate(objectMap, "retentionInDays", w.RetentionInDays) - populate(objectMap, "sku", w.SKU) - populate(objectMap, "workspaceCapping", w.WorkspaceCapping) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkspacePurgeBody. -func (w WorkspacePurgeBody) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filters", w.Filters) - populate(objectMap, "table", w.Table) - 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 -}